#include<stdio.h>
int main()
{int x,number=0,i,t=1,b;
scanf("%d",&x);
int m=x,n=x;
while(x!=0){
x=x/10;
number++;}
printf("%d\n",number);
for(i=1;i<number;i++)
t=t*10;
while(t>0){
x=m/t;
printf("%d ",x);
m=m-x*t;
t=t/10;}
printf("\n");
while(n!=0){
b=n%10;
printf("%d ",b);
n=n/10;}
return 0;
}