#include<stdio.h>
#include<string.h>
#include<ctype.h>
 void reverseSentence(char str[], int index){
     if (index < 0)
     return;
     printf("%c", str[index]);
     reverseSentence(str, index - 1);
 }
 int main(){
     char str[101];
     int i, hasDigit = 0;
     fgets(str, sizeof(str), stdin);
     str[strcspn(str, "\n")] = '\0';
     for (i=0;str[i] != '\0';i++)
     {
         if (isdigit(str[i])){
             hasDigit = 1;
             break;
         }
     }
     if (hasDigit){
         printf("Invalid input");
     }else{
         reverseSentence(str, strlen(str) - 1;)
     }
     return 0;
 }