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

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.awt.Point;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.text.*;

public class cf538b {

    static BufferedReader br;
    static Scanner sc;
    static PrintWriter out;

    public static void initA() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            sc = new Scanner(System.in);
            out = new PrintWriter(System.out);
        } catch (Exception e) {
        }
    }

    static boolean next_permutation(Integer[] p) {
        for (int a = p.length - 2; a >= 0; --a) {
            if (p[a] < p[a + 1]) {
                for (int b = p.length - 1;; --b) {
                    if (p[b] > p[a]) {
                        int t = p[a];
                        p[a] = p[b];
                        p[b] = t;
                        for (++a, b = p.length - 1; a < b; ++a, --b) {
                            t = p[a];
                            p[a] = p[b];
                            p[b] = t;
                        }
                        return true;
                    }
                }
            }
        }
        return false;
    }

    public static String getString() {
        try {
            return br.readLine();
        } catch (Exception e) {
        }
        return "";
    }

    public static Integer getInt() {
        try {
            return Integer.parseInt(br.readLine());
        } catch (Exception e) {
        }
        return 0;
    }

    public static Integer[] getIntArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            Integer temp2[] = new Integer[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = Integer.parseInt(temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static Long[] getLongArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            Long temp2[] = new Long[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = Long.parseLong(temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static String[] getStringArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            String temp2[] = new String[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = (temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static void print(Object a) {
        out.print(a);
    }

    public static void println(Object a) {
        out.println(a);
    }

    public static void printf(String s, Object... a) {
        out.printf(s, a);
    }

    public static int nextInt() {
        return sc.nextInt();
    }

    public static double nextDouble() {
        return sc.nextDouble();
    }

    public static void main(String[] ar) {
        initA();
        cf538b c = new cf538b();
        c.solve();
        out.flush();
    }

    private static class mp {

        int x, y, z;

        mp(int a, int b, int c) {
            x = a;
            y = b;
            z = c;
        }
    }
    mp dp[] = new mp[1000 * 1000 + 5];

    boolean isQ(int v) {
        while (v > 0) {
            if (v % 10 > 1) {
                return false;
            }
            v /= 10;
        }
        return true;
    }

    void solve() {

        for (int i = 0; i < dp.length; i++) {
            dp[i] = new mp(-1, -1, -1);
        }
        int n = getInt();

        ArrayList<Point> all = new ArrayList<Point>();

        ArrayList<Integer> ala = new ArrayList<Integer>();

        for (int i = 1; i <= n; i++) {
            if (isQ(i)) {
                all.add(new Point(i, 1));
                ala.add(i);
                dp[i] = new mp(1, i, 0);
            }
        }
        //println(ala.size());
        Queue<Point> Q = new ArrayDeque<Point>(all);

        while (Q.size() > 0) {
            Point p = Q.remove();
            int v = p.x;
            int lk = p.y;

            //dd[v] = lk;
            // println(v+" = "+lk);

            for (int i = 0; i < ala.size(); i++) {
                int ne = v + ala.get(i);
                if (ne <= n && dp[ne].x == -1) {
                    dp[ne] = new mp(lk + 1, v, ala.get(i));
                    Q.add(new Point(ne, lk + 1));
                }
            }
        }

        println(dp[n].x);
        
         //   println(n+" : "+dp[n].x+" "+dp[n].y+" "+dp[n].z);
        
        Queue<Integer> Q2 = new ArrayDeque<Integer>();
        
        Q2.add(dp[n].y);
        Q2.add(dp[n].z);
        
        int v = n;
        while(v>0){
            int p = Q2.remove();
            
            if(p ==0){
                continue;
            }
            if(dp[p].x==1){
                print(p+" ");
                v-=p;
                continue;
            }
            //println(p+" : "+dp[p].x+" "+dp[p].y+" "+dp[p].z);
            Q2.add(dp[p].y);
            Q2.add(dp[p].z);
            
        }
        println("");
        




    }
}
