#include<stdio.h>
#include<math.h>
int main()
{
int num;
int digots=1;//几位数
int r_num;//逆序
int ch;
scanf("%d",&num);
int temp;
temp = num;
while(1)
{
if(temp == 0)
{
digots =1;
}
else
{
temp = temp / 10;
if(temp == 0)
break;
digots++;
}
}
printf("%d\n",digots);
temp = num;
for(int i = 0; i<digots; i++)
{
int a;
a = (digots-1-i);
a = pow(10,a);
ch = num / a;
ch = ch % 10;
printf("%d ",ch);
}
printf("\n");
for(int g = 0; g<digots; g++)
{
ch = temp % 10;
temp = temp / 10;
printf("%d",ch);
}
return 0;
}