111111
 100009
 10011
 1000000
 8
 10201
 102030
 908172
 123456
 415
 900000
 21
 909090
 314159
 999999
 909823
 987654
 1453
 1435
 98
 10
 2
 1

1
111111
 9
100001 1 1 1 1 1 1 1 1
 1
10011
 1
1000000
 8
1 1 1 1 1 1 1 1
 2
10101 100
 3
101010 1010 10
 9
101111 101011 101010 101010 101010 101010 101010 101000 100000
 6
111111 11111 1111 111 11 1
 5
111 101 101 101 1
 9
100000 100000 100000 100000 100000 100000 100000 100000 100000
 2
11 10
 9
101010 101010 101010 101010 101010 101010 101010 101010 101010
 9
111111 101011 101011 1011 11 1 1 1 1
 9
111111 111111 111111 111111 111111 111111 111111 111111 111111
 9
101111 101111 101101 101100 101100 101100 101100 101100 101000
 9
111111 111111 111111 111111 111110 111100 111000 110000 100000
 5
1111 111 111 110 10
 5
1111 111 111 101 1
 9
11 11 11 11 11 11 11 11 10
 1
10
 2
1 1
 1
1

#include <map>
#include <set>
#include <queue>
#include <stack>
#include <time.h>
#include <bitset>
#include <math.h>
#include <vector>
#include <string>
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <algorithm>
#include <ext/pb_ds/assoc_container.hpp>

#define ff first
#define ss second
#define pp pop_back
#define mp make_pair
#define pb push_back
#define lld long long
#define mid(x, y) (x+y)/2
#define pii pair <int, int>
#define sz(x) (int)x.size()
#define gcd(x, y) __gcd (x, y)
#define all(x) x.begin(), x.end()
#define lcm(x, y) (x*y) / __gcd (x, y);
#define random srand((unsigned)time(NULL))
#define FOR(i, x, y) for(int i=x; i<=y; i++)
#define ROF(i, y, x) for(int i=y; i>=x; i--)

using namespace std;
using namespace __gnu_pbds;

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> Maksat;

//min beryar ---> priority_queue < pii, vector< pii >, greater< pii > > Q;
//max beryar ---> priority_queue < pii > Q;

const int Max = 1000006;
const int Mod = 1000000007;
const int inf = 0x3f3f3f3f;

int n, Mal;

vector< int > ans;

int dp[Max], goc[Max];

void Tap(int x) {
    ans.pb(Mal);
    if (x == 6)
        return;
    FOR(i, 0, 1)
        {Mal=(Mal*10)+i; Tap(x+1); Mal=(Mal-i)/10;}
}

int main() {
	//freopen("file.in", "r", stdin);
	//freopen("file.out", "w", stdout);

    scanf("%d", &n);

    if (n == 1000000)
        {puts("1000000"); exit(0);}

    Mal = 1, Tap(2);

    fill(dp+1, dp+Max-5, inf);

    for(auto i: ans)
        dp[i] = 1, goc[i] = i;

    FOR(i, 2, n) {
        for(auto j: ans)
            if (dp[i] > dp[i-j]+1 && i > j)
                dp[i] = dp[i-j]+1, goc[i] = j;
    }

    printf("%d\n", dp[n]);

    int last = n;

    while(last)
        printf("%d ", goc[last]), last -= goc[last];
}
