string word;
cin >> word;
int i,j;
for(j=0,i=word.size()-1;j<i;--i,++j)
{
char temp=word[i];
word[i]=word[j];
word[j]=temp;
}
cout << word;
string word;
cin >> word;
int i,j;
for(j=0,i=word.size()-1;j<i;--i,++j)
{
char temp=word[i];
word[i]=word[j];
word[j]=temp;
}
cout << word;