#include <stdio.h>

int main() {
    int num = 0;
    scanf("%d",&num);
    int result = 0;
    while (num != 0) 
    {
        result += num % 10;
        result *= 10;
        num /= 10;
    }

    printf("%04d",result/10);

    return 0;
}