#include <stdio.h>
#include <string.h>
#include <ctype.h>
void reverseString(char str[],int index){
    //base case
    if(index<0)
    return ;
    
    //print the character
    printf("%c",str[index]);
    //function
    reverseString(str,index-1);
    
}
int main(){
    char str[101];
    fgets(str,sizeof(str),stdin);
    
    //remove the new line character
    
    str[strcspn(str,"\n")]='\0';
    
    //check for digits
    
    for(int i=0;str[i]!='\0';i++){
        if(isdigit(str[i]){
            printf("Invalid input");
            return 0;
        }
    }
    reverseString(str,strlen(str)-1);
    return 0;
}