#include <stdio.h>
int main()
{
    int a,z,x,c,v;
    scanf("%d",&a);
    z =a/1000;
    x =a/100-z*10;
    c =a/10-z*100-x*10;
    v =a-z*1000-x*100-c*10;
    printf("%d%d%d%d",v,c,x,z);
    return 0;
}