#include <stdio.h>
#include <stdlib.h>
int main()
{
int n=0;
while ( EOF != scanf("%d", &n) )
{
int reverseNum =0;
int temp = n;
int count = 0;
while (0 != temp)
{
reverseNum = reverseNum * 10 + temp%10;
temp /= 10;
count++;
}
printf("%d %d\n", count, reverseNum);
}
return 0;
}