#include <stdio.h>
#include <ctype.h>
#include <string.h>

void reverse(char s[], int n) {
    if (n < 0)
    return;
    printf("%c", s[n]);
    reverse(s, n - 1);
    
}
int main() {
    char s[101];
    int i;
    
    gets(s);
    
    for (i = 0; s[i] != '\0'; i++) {
        if (isdigit(s[i])) {
            printf("Invalid input");
            return 0;
        }
    }
    
    reverse(s, strlen(s) - 1);
    return 0;
}