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

import java.util.*;

public class Main {
  public static Scanner in = new Scanner(System.in);
  // 538B-QuasiBinary
  public static int[] qbs = new int[]{0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000, 10001, 10010, 10011, 10100, 10101, 10110, 10111, 11000, 11001, 11010, 11011, 11100, 11101, 11110, 11111, 100000, 100001, 100010, 100011, 100100, 100101, 100110, 100111, 101000, 101001, 101010, 101011, 101100, 101101, 101110, 101111, 110000, 110001, 110010, 110011, 110100, 110101, 110110, 110111, 111000, 111001, 111010, 111011, 111100, 111101, 111110, 111111, 1000000,
    1000001, 1000010, 1000011, 1000100, 1000101, 1000110, 1000111, 1001000, 1001001, 1001010, 1001011, 1001100, 1001101, 1001110, 1001111, 1010000, 1010001, 1010010, 1010011, 1010100, 1010101, 1010110, 1010111, 1011000, 1011001, 1011010, 1011011, 1011100, 1011101, 1011110, 1011111, 1100000, 1100001, 1100010, 1100011, 1100100, 1100101, 1100110, 1100111, 1101000, 1101001, 1101010, 1101011, 1101100, 1101101, 1101110, 1101111, 1110000, 1110001, 1110010, 1110011, 1110100, 1110101, 1110110, 1110111,
    1111000, 1111001, 1111010, 1111011, 1111100, 1111101, 1111110, 1111111};
  public static int N = 1000_001;
  public static int[] minNumber = new int[N];
  public static int[] prevMin = new int[N];
  public static int[] prevQB = new int[N];

  public static void main(String[] args) {
    // TODO: Start coding here
    calculate(N);

    setValue(minNumber, -1);
    setValue(prevMin, -1);

    int n = in.nextInt();
    int x = findNumbers(n);

    // System.out.println(Arrays.toString(minNumber));
    // System.out.println(Arrays.toString(prevMin));
    // System.out.println(Arrays.toString(prevQB));

    System.out.println(minNumber[n]);
    x = n;
    while( x > 0 ) {
      int no = qbs[prevMin[x]];
      System.out.print(no + " ");
      x -= no;
    }

    System.out.println();

    in.close();
  }

  public static int findNumbers(int n) {
    if( n <= 0 ) return 0;

    int min = Integer.MAX_VALUE;
    int minIdx = -1;
    int prevQBIdx = prevQB[n];

    for(int i=1; i<=prevQBIdx; ++i) {
      int x = minNumber[n-qbs[i]];
      if( x < 0 ) {
        x = findNumbers(n-qbs[i]);
      }
      int currentNumber = 1 + x;
      if(currentNumber < min) {
        min = currentNumber;
        minIdx = i;
      }
    }
    minNumber[n] = min;
    prevMin[n] = minIdx;

    return min;
  }

  public static void calculate(int n) {
    HashMap<Integer, Integer> qbSet = new HashMap<Integer, Integer>();
    for(int i=0; i<qbs.length; ++i) {
      qbSet.put(qbs[i], i);
    }
    for(int i=0; i<prevQB.length; ++i) {
      if(qbSet.containsKey(i)) {
        prevQB[i] = qbSet.get(i);
      } else {
        prevQB[i] = prevQB[i-1];
      }
    }
  }

  public static void setValue(int[] arr, int v) {
    for(int i=0; i<arr.length; ++i) {
      arr[i] = v;
    }
  }

  public static int[] getIntArray(int n) {
    int[] arr = new int[n];
    for(int i=0; i<n; ++i) {
      arr[i] = in.nextInt();
    }
    return arr;
  }
}
