#include <stdio.h>
#include <string.h>
#define maxn (100 + 10)
char s1[maxn], s2[maxn], s3[maxn], s4[maxn], s5[maxn], line[maxn];
int cases;
void getss(char *index){
while( (*index = getchar()) != '<' && *index != '>' && *index != '\n'){
++index;
}
*index = '\0';
}
int main()
{
scanf("%d", &cases);
getchar();
while(cases--){
getss(s1);
getss(s2);
getss(s3);
getss(s4);
getss(s5);
getss(line);
line[strlen(line) - 3] = '\0';
printf("%s%s%s%s%s\n", s1, s2, s3, s4, s5);
printf("%s%s%s%s%s\n", line, s4, s3, s2, s5);
}
return 0;
}
uva 10361
最新推荐文章于 2016-07-18 14:59:43 发布