import java.io.*;
import java.util.*;

public class TestGen {
	public static void main(String[] args) {
		new TestGen().run();
	}

	BufferedReader br;
	StringTokenizer in;
	PrintWriter out;

	public String nextToken() throws IOException {
		while (in == null || !in.hasMoreTokens()) {
			in = new StringTokenizer(br.readLine());
		}
		return in.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	final int[][] bad = { { 1010, 101010, 10 }, { 10, 1010, 101010 },
			{ 1, 101000101, 100 } };

	int tNumber;

	Random rnd;

	void print(ArrayList<Integer> a) throws IOException {
		if (tNumber < 10) {
			out = new PrintWriter("0" + tNumber);
		} else {
			out = new PrintWriter("" + tNumber);
		}
		tNumber++;
		out.println(a.size());
		for (int i = 0; i < a.size() - 1; i++) {
			out.print(a.get(i) + " ");
		}
		out.println(a.get(a.size() - 1));
		out.close();
	}

	void genbad(int n) throws IOException {
		ArrayList<Integer> a = new ArrayList<Integer>();
		HashSet<Integer> hsh = new HashSet<Integer>();
		int type = rnd.nextInt(3);
		for (int i = 0; i < 3; i++) {
			a.add(bad[type][i]);
			hsh.add(bad[type][i]);
		}
		for (int i = 0; i < n; i++) {
			int k = rnd.nextInt((int) (1e+9)) + 1;
			while (hsh.contains(k)) {
				k = rnd.nextInt((int) (1e+9)) + 1;
			}
			hsh.add(k);
			a.add(k);
		}
		Collections.shuffle(a, rnd);
		print(a);
	}

	String rev(String a) {
		String res = "";
		for (int i = a.length() - 1; i >= 0; --i) {
			res += a.charAt(i);
		}
		return res;
	}

	void genfine(int n, int num) throws IOException {
		ArrayList<Integer> a = new ArrayList<Integer>();
		HashSet<Integer> hsh = new HashSet<Integer>();
		long[] pow = new long[19];
		pow[0] = 1;
		for (int i = 1; i <= 18; i++) {
			pow[i] = pow[i - 1] * 10;
		}
		for (int i = 1; i <= num; i++) {
			while (true) {
				String rs = "";
				int len = rnd.nextInt(22) + 3;
				long k = (rnd.nextLong() % pow[len / 2 + len % 2] + pow[len / 2
						+ len % 2])
						% pow[len / 2 + len % 2];
				if (len % 2 == 1) {
					rs = k + "" + rev(k / 10 + "");
				} else {
					rs = k + "" + rev(k + "");
				}
				if (rs.length() < 3) {
					continue;
				}
				int f1 = rnd.nextInt(rs.length() - 2) + 1;
				int f2 = rnd.nextInt(rs.length() - f1 - 1) + 1;
				while (rs.length() - f1 - f2 > 8 || f1 > 8 || f2 > 8) {
					f1 = rnd.nextInt(rs.length() - 2) + 1;
					f2 = rnd.nextInt(rs.length() - f1 - 1) + 1;
					continue;
				}
				long a1 = Long.parseLong(rs.substring(0, f1));
				long b1 = Long.parseLong(rs.substring(f1, f1 + f2));
				long c1 = Long.parseLong(rs.substring(f1 + f2));
				if (a1 < 1 || a1 > 1e+9 || b1 < 1 || b1 > 1e+9 || c1 < 1
						|| c1 > 1e+9) {
					continue;
				}
				if ((a1 + "").length() + (b1 + "").length()
						+ (c1 + "").length() != rs.length()) {
					continue;
				}
				if (hsh.contains((int) a1) || hsh.contains((int) b1)
						|| hsh.contains((int) c1) || a1 == b1 || a1 == c1
						|| b1 == c1) {
					continue;
				}
				hsh.add((int) a1);
				hsh.add((int) b1);
				hsh.add((int) c1);
				a.add((int) a1);
				a.add((int) b1);
				a.add((int) c1);
				break;
			}
		}
		for (int i = 0; i < n; i++) {
			int k = rnd.nextInt((int) (1e+9)) + 1;
			while (hsh.contains(k)) {
				k = rnd.nextInt((int) (1e+9)) + 1;
			}
			hsh.add(k);
			a.add(k);
		}
		Collections.shuffle(a, rnd);
		print(a);
	}

	void genbadfine(int n, int a1, int b, int c) throws IOException {
		int type = rnd.nextInt(3);
		ArrayList<Integer> a = new ArrayList<Integer>();
		HashSet<Integer> hsh = new HashSet<Integer>();
		for (int i = 0; i < 3; i++) {
			a.add(bad[type][i]);
			hsh.add(bad[type][i]);
		}
		a.add(a1);
		a.add(b);
		a.add(c);
		hsh.add(a1);
		hsh.add(b);
		hsh.add(c);
		for (int i = 0; i < n; i++) {
			int k = rnd.nextInt((int) (1e+9)) + 1;
			while (hsh.contains(k)) {
				k = rnd.nextInt((int) (1e+9)) + 1;
			}
			hsh.add(k);
			a.add(k);
		}
		Collections.shuffle(a, rnd);
		print(a);
	}

	public void solve() throws IOException {
		tNumber = 4;
		rnd = new Random(239);
		for (int i = 0; i < 3; i++) {
			genbad(rnd.nextInt(97) + 1);
		}
		for (int j = 1; j <= 4; j++) {
			for (int i = 0; i < 3; i++) {
				genfine(rnd.nextInt(100 - j - 1) + 1, j);
			}
		}
		genfine(0, 33);
		genbadfine(100, 92345543, 2, 9);
		genbadfine(100, 8, 7, 66666678);
		genbadfine(100, 7200020, 20002, 7);
		genbadfine(100, 772, 200000227, 7);
		genbadfine(100, 772, 2, 100012277);

		for (int i = 0; i < 3; i++) {
			genbad(rnd.nextInt(897) + 1);
		}
		for (int j = 1; j <= 4; j++) {
			for (int i = 0; i < 3; i++) {
				genfine(rnd.nextInt(200 - j - 1)+700 + 1, j);
			}
		}
		genfine(0, 300);
		genbadfine(850, 92345543, 2, 9);
		genbadfine(850, 8, 7, 66666678);
		genbadfine(850, 7200020, 20002, 7);
		genbadfine(850, 772, 200000227, 7);
		genbadfine(850, 772, 2, 100012277);

		
		
	}

	public void run() {
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}