#include
#include
int main(int argc, const char * argv[]) {
int broj;
scanf("%d", &broj);
int prevrten_broj = 0;
while(broj > 0) {
int cifra = broj % 10;
prevrten_broj = (prevrten_broj * 10) + cifra;
broj /= 10;
}
while(prevrten_broj > 0) {
int cifra = prevrten_broj % 10;
printf("%d\n", cifra);
prevrten_broj /= 10;
}
return 0;
}