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.io.BufferedReader;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.StringTokenizer;


public class con538_B_DP {

	static int MB = 1 << 20;
	static BufferedReader br = new BufferedReader(new InputStreamReader(
			System.in, StandardCharsets.US_ASCII), 10 * MB);
	static StringTokenizer st;

	static String NL() throws Exception {
		String s = br.readLine();
		st = new StringTokenizer(s);
		return s;
	}

	static String NT() {
		return st.nextToken();
	}

	public static void main(String[] args) throws Exception {
		NL();
		int N = Integer.parseInt(NT());
		print(solve(N));
	}

	private static void print(List<Integer> list) {
		StringBuilder sb = new StringBuilder();
		sb.append(list.size()).append('\n');
		sb.append(list.get(0));
		for (int i = 1; i < list.size(); i++) {
			sb.append(' ').append(list.get(i));
		}
		System.out.println(sb);		
	}

	static Integer[] CACHE = new Integer[1000_001];
	static List<Integer>[] L = new ArrayList[1000_001];
	
	static List<Integer> prep = new ArrayList<>();
	static {
		for (int i = 1; i <= 1 << 6; i++) {
			String bin = Integer.toBinaryString(i);
			int dec = Integer.parseInt(bin, 10);
			prep.add(dec);
			CACHE[dec] = 1;
			L[dec] = new ArrayList<>(1);
			L[dec].add(dec);
		}
	}
	
	private static List<Integer> solve(int N) {
		if (CACHE[N] != null) {
			return L[N];
		}
		for (int i = 1; i <= N; i++) {
			if (CACHE[i] != null) continue;
			int best = i + 1;
			int bp = -1;
			for (int p : prep) {
				if (p > i) break;
				int tmp = CACHE[i-p] + 1;
				if (tmp < best) {
					best = tmp;
					bp = p;
				}
			}
			CACHE[i] = best;
			List<Integer> old = L[i - bp];
			L[i] = new ArrayList<>(old.size() + 1);
			L[i].addAll(old);
			L[i].add(bp);
		}
		return L[N];
	}

	static class State implements Comparable<State> {
		int sum = 0;
		List<Integer> list = new ArrayList<>(0);
		
		public State() {
		}
		
		public State(State o, int n) {
			sum = o.sum + n;
			this.list = new ArrayList<>(o.list.size() + 1);
			this.list.addAll(o.list);
			this.list.add(n);
		}
		
		@Override
		public int compareTo(State o) {
			if (list.size() == o.list.size()) return Integer.compare(o.sum, this.sum);
			return Integer.compare(list.size(), o.list.size());
		}
		
		@Override
		public String toString() {
			return String.format("sum=%d, list=%s", sum, list.toString());
		}
	}

}
