#include<iostream>
#include<string>
#include<cstring>
using namespace std;
int main()
{
int n;
int a[1000];
while(cin >> n)
{
int len = 1, g= 10;//计算数字的长度;;
while(n/g)
{
len++;
g = g*10;
}
memset(a, 0, sizeof(a));
int h = 1, s=0, m, k = 0;
while(h)
{
m = n;
s = n%10;//取反第一个数,
n = n/10;
for(int i = 1; i < len; i++)//将其他几位都取反;
{
s = s*10 + n%10;
n = n/10;
}
if(s != m)
{
a[k++] = m;
n = s+m;
g = 10;
len = 1;
while(n/g)//要重新算出它的长度;;;;吐槽下:
//我就是因为没重新计算它的长度,弄了1个多小时,
{
len++;
g = g*10;
}
}
else
h = 0;
}
cout << k << endl;
for(int i = 0; i < k; i++)
cout << a[i] << "--->";
cout << s << endl;
}
return 0;
}