#include <bits/stdc++.h>
using namespace std;
ofstream fo("dqnd.out");
ifstream fi("dqnd.inp");
long int x;int t=0;
void doi(long int x)
{	
	if(x<10)
	{t++;
	fo<<x<<endl<<t;}
else
{
fo<<x%10;
	t++;
	doi(x/10);
}}
int main() {
	fi>>x;
	doi(x);
	return 0;
}