#include<iostream>
using namespace std;
int main (){
char str[209];
int i;
int T;
scanf("%d",&T);
while(T--){
scanf("%s",str);
for(i=strlen(str)-1;i>=0;i--){
printf("%c",str[i]);
}
printf("\n");
}
system ("pause");
return 0;
}
#include<iostream>
using namespace std;
int main (){
char str[209];
int i;
int T;
scanf("%d",&T);
while(T--){
scanf("%s",str);
for(i=strlen(str)-1;i>=0;i--){
printf("%c",str[i]);
}
printf("\n");
}
system ("pause");
return 0;
}