#include <bits/stdc++.h>
using namespace std;
int countdig(int n)
{
int c=0;
while(n)
{
c++;n/=10;
}
return c;
}
int s[10][1000]={0};
int p[1000009]={0},v=0;
bool cmp(int a,int b)
{
return a>b;
}
void init()
{
for(int i=1;i<=7;i++)
{
int mul=1,j=2,p,k;
while(j<=i)mul*=10,j++;
s[i][0]=mul;//cout<<mul<<" ";
k=1;
p=i-1;
bool h[1200009]={0};
while(p>0){
for(int j=0;j< (1<<(p-1)) ;j++)
{
if(h[mul+s[p][j]]==0)
{
h[mul+s[p][j]]=1;
s[i][k++]=mul+s[p][j];
// cout<<s[i][k-1]<<" ";
}
}
p--;
}
sort(s[i],s[i]+(1<<(i-1)),cmp);
// cout<<endl;
}
}
int main()
{
init();
int n,res=0;
cin>>n;
if(n==0)cout<<"0"<<endl;
while(n)
{
int i=0,t,c=countdig(n);
while(countdig(n)==c)
{
// cout<<"n="<<n<<" c="<<c<<" s[c][i]="<<s[c][i];//<<endl;
t=n/s[c][i];
// cout<<" t="<<t<<endl;
if(t>0)
{
res+=t;
for(int j=0;j<t;j++)
p[v++]=s[c][i];
}
// i++;
// cout<<"n="<<n<<endl;
n-=t*s[c][i];//i++;
// cout<<"n="<<n<<endl;
i++;
}
}
cout<<res<<endl;
for(int i=0;i<v;i++)cout<<p[i]<<" ";cout<<endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBjb3VudGRpZyhpbnQgbikKewoJaW50IGM9MDsKCXdoaWxlKG4pCgl7CgkJYysrO24vPTEwOwoJfQoJcmV0dXJuIGM7Cn0KaW50IHNbMTBdWzEwMDBdPXswfTsKaW50IHBbMTAwMDAwOV09ezB9LHY9MDsKYm9vbCBjbXAoaW50IGEsaW50IGIpCnsKCXJldHVybiBhPmI7Cn0Kdm9pZCBpbml0KCkKewoJZm9yKGludCBpPTE7aTw9NztpKyspCgl7CgkJaW50IG11bD0xLGo9MixwLGs7CgkJd2hpb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