#include <stdio.h>
#include <math.h>
int main()
{
int i;
char str[5] = {'0'};
char str1[5] = {0};
long num = 0;
int wei_num;
long daoxu_num = 0;
scanf("%ld",&num);
sprintf(str,"%ld",num);//数字分散为字符
for(i = 0; i < 5; i++)//去字符
{
str1[i] = str[i]-'0';
if(str1[i] < 0)
{
str1[i] = 0;
}
}
for(i = 4; i >= 0; i--)//判断数字的位数
{
if(str1[i] != 0)
{
wei_num = i + 1;
break;
}
}
printf("%d\n",wei_num);
for(i = 0; i < wei_num; i++)//输出离散后的数字
{
printf("%d",str1[i]);
if(i == wei_num)
{
break;
}
printf(" ");
}
printf("\n");
for(i = wei_num-1; i >= 0; i--)//数字逆序
{
daoxu_num += str1[i] * (long)pow(10, i);
}
printf("%ld\n",daoxu_num);
return 0;
}