#include<stdio.h>
#include<string.h>
int main () {
char s[1000];
scanf("%s",s);
int i = 0;
while(s[strlen(s) - 1 - i] == '0') {
i++;
}
for(int j = strlen(s) - 1 - i; j >= 0; j--) {
printf("%c",s[j]);
}
if(strlen(s) == i)
printf("0");
return 0;
}