#include <bits/stdc++.h>
using namespace std;
#define inf 100000000
#define maxn 1000000
#define pb push_back
vector<int> v1, v2, v3;
int dp[maxn+100];
void solve1(int num)
{
if(num==0)
return;
int i, curmin, cura, n;
curmin = inf;
for(i=0; v1[i]<=num; i++){
cura = 1+dp[num-v1[i]];
if(cura<curmin){
curmin = cura;
n = v1[i];
}
}
v3.pb(n);
solve1(num-n);
}
int main()
{
int i, j, num;
v1.pb(1);
for(i=2; i<=6; i++){
num = 1;
for(j=0; j<i-1; j++)
num*=10;
v2.clear();
for(j=0; j<v1.size(); j++){
v2.pb(num+v1[j]);
}
v1.pb(num);
for(j=0; j<v2.size(); j++)
v1.pb(v2[j]);
}
v1.pb(1000000);
sort(v1.begin(), v1.end());
dp[1] = 1;
for(i=2; i<=maxn; i++){
dp[i] = inf;
for(j=0; v1[j]<=i; j++){
dp[i] = min(dp[i], (1+dp[i-v1[j]]));
}
}
//cout << dp[2] << "\n";
scanf("%d", &num);
solve1(num);
printf("%d\n", v3.size());
for(i=0; i<v3.size(); i++)
printf("%d ", v3[i]);
printf("\n");
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKI2RlZmluZSBpbmYgMTAwMDAwMDAwCiNkZWZpbmUgbWF4biAxMDAwMDAwCgojZGVmaW5lIHBiIHB1c2hfYmFjawoKdmVjdG9yPGludD4gdjEsIHYyLCB2MzsKaW50IGRwW21heG4rMTAwXTsKCnZvaWQgc29sdmUxKGludCBudW0pCnsKICAgIGlmKG51bT09MCkKICAgICAgICByZXR1cm47CiAgICBpbnQgaSwgY3VybWluLCBjdXJhLCBuOwogICAgY3VybWluID0gaW5mOwogICAgZm9yKGk9MDsgdjFbaV08PW51bTsgaSsrKXsKICAgICAgICBjdXJhID0gMStkcFtudW0tdjFbaV1dOwogICAgICAgIGlmKGN1cmE8Y3VybWluKXsKICAgICAgICAgICAgY3VybWluID0gY3VyYTsKICAgICAgICAgICAgbiA9IHYxW2ldOwogICAgICAgIH0KICAgIH0KICAgIHYzLnBiKG4pOwogICAgc29sdmUxKG51bS1uKTsKfQoKaW50IG1haW4oKQp7CgogICAgaW50IGksIGosIG51bTsKICAgIHYxLnBiKDEpOwogICAgZm9yKGk9MjsgaTw9NjsgaSsrKXsKICAgIAludW0gPSAxOwogICAgCWZvcihqPTA7IGo8aS0xOyBqKyspCiAgICAJCW51bSo9MTA7CiAgICAgICAgdjIuY2xlYXIoKTsKICAgICAgICBmb3Ioaj0wOyBqPHYxLnNpemUoKTsgaisrKXsKICAgICAgICAgICAgdjIucGIobnVtK3YxW2pdKTsKICAgICAgICB9CiAgICAgICAgdjEucGIobnVtKTsKICAgICAgICBmb3Ioaj0wOyBqPHYyLnNpemUoKTsgaisrKQogICAgICAgICAgICB2MS5wYih2MltqXSk7CiAgICB9CiAgICB2MS5wYigxMDAwMDAwKTsKICAgIHNvcnQodjEuYmVnaW4oKSwgdjEuZW5kKCkpOwogICAgZHBbMV0gPSAxOwogICAgZm9yKGk9MjsgaTw9bWF4bjsgaSsrKXsKICAgIAlkcFtpXSA9IGluZjsKICAgIAlmb3Ioaj0wOyB2MVtqXTw9aTsgaisrKXsKICAgIAkJZHBbaV0gPSBtaW4oZHBbaV0sICgxK2RwW2ktdjFbal1dKSk7CiAgICAJfQogICAgfQogICAgLy9jb3V0IDw8IGRwWzJdIDw8ICJcbiI7CiAgICAgICAgc2NhbmYoIiVkIiwgJm51bSk7CiAgICAgICAgc29sdmUxKG51bSk7CiAgICAgICAgcHJpbnRmKCIlZFxuIiwgdjMuc2l6ZSgpKTsKICAgICAgICBmb3IoaT0wOyBpPHYzLnNpemUoKTsgaSsrKQogICAgICAgICAgICBwcmludGYoIiVkICIsIHYzW2ldKTsKICAgICAgICBwcmludGYoIlxuIik7CiAgICByZXR1cm4gMDsKfQ==