#include<stdio.h>
#include<string.h>
#define M 100001
int main()
{
char str[M];
while(gets(str))
{
int sum=0,i;
int n=strlen(str);
for(i=0;i<n;i++)
{
sum+=str[i]-'0';
printf("%d%c",str[i]-'0',i==n-1? '\n':' ');
}
printf("%d\n",sum);
}
return 0;
}
#include<string.h>
#define M 100001
int main()
{
char str[M];
while(gets(str))
{
int sum=0,i;
int n=strlen(str);
for(i=0;i<n;i++)
{
sum+=str[i]-'0';
printf("%d%c",str[i]-'0',i==n-1? '\n':' ');
}
printf("%d\n",sum);
}
return 0;
}