#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void)
{
int num = 0;
if(scanf("%d" , &num) != 1)
{
printf("Input error!") ;
return 0 ;
}
char TempBuff[20] ;
sprintf(TempBuff , "%d" , num) ;
int len = strlen(TempBuff)-1 ;
int i = 0 ;
char tempC ;
while(i < len)
{
tempC = TempBuff[i] ;
TempBuff[i] = TempBuff[len] ;
TempBuff[len] = tempC ;
i++ ;
len-- ;
}
printf("%s\n" , TempBuff) ;
printf("%d" , atoi(TempBuff)) ;
return 0 ;
}