#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int l = n / 100000;
int w = (n / 10000) % 10;
int q = (n / 1000) % 10;
int b = (n / 100) % 10;
int s = (n / 10) % 10;
int g = n % 10;
printf("%d\n%d\n%d\n%d\n%d\%d\n%d",g,s,b,q,w,l);
return 0;
}
/**************************************************************
Problem: 1611
User: fuhoubin
Language: C++
Result: Wrong Answer
****************************************************************/