A number is called quasibinary if its decimal representation contains only digits 0 or 1. For example, numbers 0, 1, 101, 110011 — are quasibinary and numbers 2, 12, 900 are not.

You are given a positive integer n. Represent it as a sum of minimum number of quasibinary numbers.


-----Input-----

The first line contains a single integer n (1 ≤ n ≤ 10^6).


-----Output-----

In the first line print a single integer k — the minimum number of numbers in the representation of number n as a sum of quasibinary numbers.

In the second line print k numbers — the elements of the sum. All these numbers should be quasibinary according to the definition above, their sum should equal n. Do not have to print the leading zeroes in the numbers. The order of numbers doesn't matter. If there are multiple possible representations, you are allowed to print any of them.


-----Examples-----
Input
9

Output
9
1 1 1 1 1 1 1 1 1 

Input
32

Output
3
10 11 11

Source: codeforces | Difficulty: MEDIUM
Tags: Greedy algorithms

Dynamic programming

Implementation

Constructive algorithms


Solutions:
n = int(input())
s = ''
ans = 0
while n > 0:
	m = int(''.join(['1' if d != '0' else '0' for d in str(n)]))
	n -= m
	if n >= 0:
		ans += 1
		s += str(m) + ' '
print(ans, s, sep='\n')


def main():
	string = str(input())
	arr = [int(x) for x in string]
	mx = max(arr)
	print(mx)
	for _ in range(mx):
		res = ''
		for i in range(len(arr)):
			if arr[i] > 0:
				res += '1'
				arr[i] -= 1
			else:
				res += '0'
		for i in range(len(res)):
			if res[i] == '1':
				break
		print(res[i:], end=' ')
main()


import math
import sys
from bisect import bisect_left, bisect_right
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input().strip()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())

def recur(n):
	if n > 10 ** 6:
		return
	s.add(n)
	recur(n * 10)
	recur(n * 10 + 1)
s = set()
recur(1)
l = list(s)
l.sort()
n = inp()
k = bisect_right(l, n)
l = l[:k]
dp = [sys.maxsize for i in range(n + 1)]
dp[0] = 0
num = n
v = [0 for i in range(n + 1)]
for i in range(1, n + 1):
	for each in l:
		if each <= i:
			if dp[i - each] + 1 < dp[i]:
				dp[i] = dp[i - each] + 1
				v[i] = each
print(dp[n])
while num > 0:
	print(v[num], end=' ')
	num -= v[num]


ans = []
n = int(input())
while n:
	d = ''.join((min(i, '1') for i in str(n)))
	n -= int(d)
	ans.append(d)
print(len(ans))
print(*ans)


a = input()
b = max(map(int, a))
c = [0] * 9
for i in a:
	for j in range(9):
		c[j] *= 10
	for j in range(int(i)):
		c[j] += 1
print(b)
print(' '.join(map(str, [i for i in c if i])))


n = int(input())
k = n
ans = []
while k != 0:
	s = str(k)
	bin = ''
	for c in s:
		if c == '0':
			bin += '0'
		else:
			bin += '1'
	d = int(bin)
	ans.append(d)
	k -= d
print(len(ans))
print(' '.join(map(str, ans)))


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
n = int(data())
answer = []
while n:
	(temp, i, res) = (n, 1, 0)
	while temp:
		if temp % 10:
			res += i
		temp //= 10
		i *= 10
	n -= res
	answer.append(res)
out(len(answer))
out(*answer)


import sys
import math
from collections import Counter
n = input()
m = max((int(i) for i in n))
res = [''] * m
for i in range(len(n)):
	for j in range(int(n[i])):
		res[j] += '1'
	for j in range(int(n[i]), m):
		res[j] += '0'
print(m)
for s in res:
	print(int(s), end=' ')
print


n = int(input())
s = str(n)
ans = []
while n > 0:
	s = list(s)
	for i in range(len(s)):
		if s[i] != '0':
			s[i] = '1'
	s = ''.join(s)
	ans.append(s)
	n -= int(s)
	s = str(n)
print(len(ans))
print(*ans)


a = [int(i) for i in input()]
tmp = max(a)
ans = []
for i in range(tmp):
	temp = []
	for i in range(len(a)):
		if a[i] > 0:
			a[i] -= 1
			temp.append('1')
		else:
			temp.append('0')
	ans.append(int(''.join(temp)))
print(len(ans))
for i in ans:
	print(i, end=' ')


n = list(map(int, input()))
print(max(n))
for _ in range(max(n)):
	res = []
	for i in range(len(n)):
		if n[i] > 0:
			n[i] -= 1
			res += ['1']
		elif len(res) > 0:
			res += ['0']
	print(''.join(res))


answer = []
n = input()
n = int(n)
while n:
	(temp, num, m) = (n, 0, 1)
	temp = int(temp)
	while temp:
		if temp % 10:
			num += m
		temp = temp // 10
		m = m * 10
	answer.append(num)
	n = n - num
print(len(answer))
for i in range(0, len(answer)):
	print(answer[i], end=' ')
print()


from collections import defaultdict

def quasiBelow(n):
	d = defaultdict(list)
	d[0].append(0)
	d[1].append(1)
	for i in range(2, len(str(n)) + 1):
		for item in d[i - 1]:
			d[i].append(item * 10 + 0)
			d[i].append(item * 10 + 1)
	return d

def minRepr(n):
	d = quasiBelow(n)
	dp = [(0, [])] * (n + 5)
	dp[0] = (0, [])
	dp[1] = (1, [1])
	for i in range(2, n + 1):
		m = len(str(i))
		minR = (i + 1, [])
		minItem = d[m][0]
		for item in d[m]:
			if i - item < 0:
				continue
			a = dp[i - item]
			if a[0] < minR[0]:
				minR = a
				minItem = item
		dp[i] = (1 + minR[0], [minItem] + minR[1])
	return dp[n]
n = int(input())
res = minRepr(n)
print(res[0])
for v in res[1]:
	print(v, end=' ')


log = lambda *x: print(*x)

def cin(*fn, def_fn=str):
	(i, r) = (0, [])
	if fn:
		def_fn = fn[0]
	for c in input().split(' '):
		r += [(fn[i] if len(fn) > i else def_fn)(c)]
		i += 1
	return r

def q(n):
	(c, ln) = (0, 0)
	while n:
		l = n % 10
		if ln == 0:
			c = l if l == 0 else 1
		elif l != 0:
			c = 1 * 10 ** ln + c
		ln += 1
		n //= 10
	return c

def minQ(t):
	a = []
	while t:
		v = q(t)
		a += [v]
		t -= v
	return a
(n,) = cin(int)
r = minQ(n)
log(len(r))
log(' '.join((str(c) for c in r)))


n = list(map(int, list(input().strip())))
ans = []
while any(n):
	cur = 0
	for i in range(len(n)):
		cur *= 10
		if n[i]:
			cur += 1
			n[i] -= 1
	ans.append(cur)
print(len(ans))
print(*ans)


import sys
inf = float('inf')
mod = 1000000007

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline()

def precompute(x):
	while x > 0:
		d = x % 10
		if d != 0 and d != 1:
			return False
		x //= 10
	return True

def main():
	coins = []
	for i in range(int(pow(10, 6)) + 1):
		if precompute(i) == True:
			coins.append(i)
	n = int(input())
	dp = [inf for _ in range(n + 1)]
	opti = [0 for _ in range(n + 1)]
	dp[0] = 0
	for i in range(1, n + 1):
		for j in coins:
			if j > i:
				break
			if 1 + dp[i - j] < dp[i]:
				dp[i] = 1 + dp[i - j]
				opti[i] = j
	print(dp[n])
	op = []
	i = n
	while i != 0:
		op.append(opti[i])
		i -= opti[i]
	print(*op)
main()


strN = input()
l = len(strN)
strN = list(map(int, list(strN)))
k = max(strN)
print(k)
res = [0 for i in range(k)]
for i in range(l):
	for j in range(strN[i]):
		res[j] += 10 ** (l - i - 1)
print(*res, sep=' ')


import math
from decimal import *
c = []

def coins(x):
	if len(x) == 7:
		c.append(int(x))
	else:
		c.append(int(x + '1'))
		coins(x + '1')
		if x != '':
			c.append(int(x + '0'))
			coins(x + '0')
coins('')
c = sorted(c)
n = int(input())
dp = [int(100000000.0)] * (n + 1)
ans = [[]] * (n + 1)
dp[0] = 0
for i in range(1, n + 1):
	for j in c:
		if i - j >= 0:
			if dp[i - j] + 1 < dp[i]:
				dp[i] = dp[i - j] + 1
				ans[i] = ans[i - j] + [str(j)]
		else:
			break
print(len(ans[-1]))
print(' '.join(ans[-1]))


(z, zz) = (input, lambda : list(map(int, z().split())))
fast = lambda : stdin.readline().strip()
zzz = lambda : [int(i) for i in fast().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
s = z()
m = int(max(s))
print(m)
for i in range(m):
	print(int(''.join(('1' if int(c) > i else '0' for c in s))), end=' ')
print()


n = int(input())
l = []
while n != 0:
	b = ''
	for i in str(n):
		b += str(min(int(i), 1))
	n -= int(b)
	l.append(b)
print(len(l))
print(*l)


n = input()
maxx = 0
for i in n:
	maxx = max(maxx, int(i))
d = [[0 for i in range(len(n))] for j in range(maxx)]
for i in range(len(n)):
	for j in range(int(n[i])):
		d[j][i] = 1
print(maxx)
for i in d:
	s = ''
	for j in i:
		if j == 0 and len(s) == 0:
			continue
		s += str(j)
	print(s, end=' ')


x = list(input())
r = []
while int(''.join(x)) > 0:
	v = []
	for (i, val) in enumerate(x):
		if int(val) > 0:
			v.append('1')
			x[i] = str(int(val) - 1)
		else:
			v.append('0')
	r.append(int(''.join(v)))
	x = list(str(int(''.join(x))))
print(len(r))
for x in r:
	print(x, end=' ')
print()


d = list(map(int, list(input())))
r = []
n = len(d)
for i in range(n):
	while d[i] > 0:
		w = ''
		for j in range(i, n):
			if d[j] > 0:
				d[j] -= 1
				w += '1'
			else:
				w += '0'
		r.append(w)
print(len(r))
print(' '.join(r))


t = int(input())
a = []
while t:
	n = t
	m = 0
	p = 1
	while n:
		if n % 10:
			m += p
		n = n // 10
		p *= 10
	a.append(m)
	t -= m
a.sort()
print(len(a))
print(' '.join((str(x) for x in a)))


def qasi(n):
	if n == 0:
		print(1)
		print(0)
		return
	c = 0
	l = []
	while n >= 1:
		s = str(n)
		ans = ''
		for x in s:
			if x != '0':
				ans += '1'
			else:
				ans += '0'
		n -= int(ans)
		s += ans
		c += 1
		l.append(ans)
	print(c)
	for x in l:
		print(x, end=' ')
	print()
	return
t = int(input())
qasi(t)


s = input()
m = 0
for c in s:
	m = max(m, int(c))
print(m)
for i in range(m):
	flag = False
	for c in s:
		if int(c) > i:
			print(1, end='')
			flag = True
		elif flag:
			print(0, end='')
	print(' ', end='')


n = list(map(int, list(input())))
ans = int(max(n))
print(ans)
s = ''
while ans:
	for i in range(len(n)):
		if n[i] >= 1:
			s += '1'
			n[i] -= 1
		else:
			s += str(n[i])
	print(int(s), end=' ')
	s = ''
	ans -= 1


s = input()
num = list()
res = list()
for i in s:
	num.append(int(i))
while True:
	tmps = ''
	for (i, v) in enumerate(num):
		if v > 0:
			num[i] -= 1
			tmps += '1'
		else:
			tmps += '0'
	res.append(int(tmps))
	if all(map(lambda x: x == 0, num)):
		break
print(len(res))
print(' '.join(map(str, res)))


quasiNumbers = []
num = input()
l = len(num)
m = n = int(num)
x = max(num)
maxi = int(x)
print(x)
for i in range(maxi):
	j = l - 1
	s = 0
	while j >= 0:
		k = n // 10 ** j
		n = n % 10 ** j
		if k > 0:
			s = s * 10 + 1
		else:
			s = s * 10
		j -= 1
	f = str(s)
	quasiNumbers.append(f)
	n = m - s
	m = n
T = ' '.join(quasiNumbers)
print(T)


n = int(input())
digs = [int(i) for i in str(n)]
x = max([int(i) for i in str(n)])
print(x)
tenpow = len(str(n)) - 1
ans = [0] * x
for i in range(len(digs)):
	for j in range(digs[i]):
		ans[j] += 10 ** tenpow
	tenpow -= 1
print(*ans)


n = int(input())
k = 0
S1 = []
S = str(n)
S2 = []
while sum(S1) < n:
	v = ''
	for i in range(len(S)):
		if S[i] == '0' and v != '':
			v = v + S[i]
		elif S[i] != '0':
			v = v + '1'
			S = S[:i] + str(int(S[i]) - 1) + S[i + 1:]
	if v != '':
		S1.append(int(v))
	k = k + 1
print(k)
for i in range(k):
	S2.append(str(S1[i]))
print(' '.join(S2))


def to(n):
	return int(bin(n)[2:])

def main():
	n = int(input())
	ar = []
	x = 1
	while to(x) <= n:
		ar.append(to(x))
		x += 1
	d = [10 ** 7] * (n + 1)
	c = [[] for i in range(n + 1)]
	for i in ar:
		d[i] = 1
		c[i] = [i]
	for i in range(1, n + 1):
		for j in ar:
			if d[i - j] + 1 < d[i]:
				d[i] = d[i - j] + 1
				c[i] = c[i - j] + [j]
	print(d[n])
	print(*c[n])
main()


n = int(input())
nums = str(n)
m = -1
for i in nums:
	m = max(m, int(i))
ans = [[0 for i in range(len(nums))] for j in range(m)]
c = 0
for i in nums:
	cur = int(i)
	for i in range(cur):
		ans[i][c] = 1
	c += 1
print(len(ans))
for i in ans:
	c = ''
	for j in i:
		c += str(j)
	print(int(c))


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
ans = []
n = int(input())
while n:
	d = ''
	for i in str(n):
		d += min(i, '1')
	n -= int(d)
	ans.append(d)
print(len(ans))
print(*ans)


def main():
	from sys import stdin, stdout
	n = int(stdin.readline())
	ans = []
	while n:
		t = ''
		num = str(n)
		for i in num:
			if int(i):
				t += '1'
			else:
				t += '0'
		ans.append(t)
		n -= int(t)
	stdout.write(str(len(ans)) + '\n')
	for i in ans:
		stdout.write(i + ' ')
main()


n = int(input())
a = []
while n > 0:
	d = int(''.join((min(x, '1') for x in str(n))))
	n -= d
	a += [d]
print(len(a))
print(' '.join(map(str, a)))


__author__ = 'girish'

def find(n):
	li = list(map(int, n))
	all = max(li)
	ansL = [[] for _ in range(all)]
	now_max = li[0]
	for i in li:
		if now_max < i:
			now_max = i
		for it in range(now_max):
			if it < i:
				ansL[it].append('1')
			else:
				ansL[it].append('0')
	for w in range(len(ansL)):
		ansL[w] = ''.join(ansL[w])
	print(len(ansL))
	return ' '.join(ansL)
print(find(input()))


__author__ = 'Bian'
import math
n = int(input())
result = []
while n > 0:
	a = math.floor(math.log10(n))
	n -= 10 ** a
	for i in range(len(result)):
		if result[i] > 10 ** a and str(result[i])[-a - 1] == '0':
			result[i] += 10 ** a
			break
	else:
		result.append(10 ** a)
print(len(result))
print(' '.join([str(x) for x in result]))


from sys import stdin, stdout
import math
from copy import deepcopy
import sys

def check(arr):
	for i in range(len(arr)):
		if arr[i] > 0:
			return True
	return False

def parse(arr):
	temp = []
	for string in arr:
		for j in range(len(string)):
			if string[j] != '0':
				temp.append(string[j:])
				break
	return temp
narr = list(stdin.readline().strip())
for i in range(len(narr)):
	narr[i] = int(narr[i])
print(max(narr))
ans = []
while check(narr):
	t = ''
	for i in range(len(narr)):
		if narr[i] > 0:
			t += '1'
			narr[i] -= 1
		else:
			t += '0'
	ans.append(t)
ans = parse(ans)
print(*ans)


n = int(input())
sn = str(n)
l = len(sn)

def getDecimal(n):
	return len(str(n)) - 1

def intAr(a):
	b = []
	for i in a:
		b.append(int(i))
	return b

def getQDNumber(number):
	inum = int(number)
	_n = intAr(number)
	n = ''
	pointer = 0
	_len = len(number)
	if inum:
		if inum >= 10:
			while 1:
				if _n[pointer] is 0:
					n += '0'
				else:
					_n[pointer] -= 1
					n += '1'
				pointer += 1
				if pointer >= _len:
					break
		else:
			n = '1'
		if inum - int(n) >= 0:
			return n + ' ' + str(getQDNumber(str(inum - int(n))))
	return ''
n = getQDNumber(sn)
print(len(n.split(' ')) - 1)
print(n)


a = list(map(int, list(input())))
x = []
g = max(a)
for _ in range(g):
	c = ''
	for i in range(len(a)):
		if a[i] > 0:
			a[i] -= 1
			c = c + '1'
		elif c:
			c = c + '0'
	x += [c]
print(g)
print(*sorted(x))


n = input()
k = max(n)
print(k)
for _ in range(1, int(k) + 1):
	f = ''
	for i in n:
		if int(i) >= _:
			f += '1'
		else:
			f += '0'
	print(int(f), end=' ')


n = int(input())
s = list(map(int, str(n)))
print(max(s))
l = len(s)
for i in range(max(s)):
	f = 0
	for i in range(l):
		if s[i] > 0:
			s[i] -= 1
			print(1, end='')
			f = 1
		elif f:
			print(0, end='')
	print(' ', end='')


import math as m
n = int(input())
ans = []
while n:
	t = 0
	for i in range(len(str(n))):
		if n // 10 ** i % 10:
			t += 10 ** i
	ans.append(str(t))
	n -= t
print('{0}\n{1}'.format(len(ans), ' '.join(ans)))


from collections import Counter, defaultdict, deque
import heapq as hq
from itertools import count, islice
import math
import sys
input = sys.stdin.readline
n = str(int(input()))
dp = [['0'] * len(n) for i in range(10)]
for i in range(len(n)):
	for j in range(int(n[i])):
		dp[j][i] = '1'
print(max(n))
for el in dp:
	num = ''.join(el)
	if '1' in num:
		print(num.lstrip('0'), end=' ')


n = str(input())
n = list(n)
l = len(n)
m = int(max(n))
print(m)
pseudo = [''] * m
for i in n:
	i = int(i)
	for j in range(m):
		if j < i:
			pseudo[j] += '1'
		else:
			pseudo[j] += '0'
pseudo = [int(k) for k in pseudo]
pseudo = [str(k) for k in pseudo]
print(' '.join(pseudo))


n = list(input())
t = int(max(n))
ans = []
for i in range(t):
	ans.append(['0'] * len(n))
for i in range(len(n)):
	c = int(n[i])
	for j in range(c):
		ans[j][i] = '1'
ans2 = []
for i in ans:
	ans2.append(int(''.join(i)))
print(t)
ans2.sort()
print(*ans2)


n = list(map(int, list(input())))
print(max(n))
for _ in range(max(n)):
	x = ''
	for l in range(len(n)):
		if n[l] > 0:
			x += '1'
			n[l] -= 1
		else:
			x += '0'
	print(int(x), end=' ')


(n, out) = (input(), [])
digits = list(map(int, n))
while sum(digits) > 0:
	o = [1 if d > 0 else 0 for d in digits]
	digits = [x - y for (x, y) in zip(digits, o)]
	out.append(int(''.join(map(str, o))))
print(len(out))
print(' '.join(map(str, out)))


n = int(input())
f = []
while n != 0:
	k = ''
	for i in str(n):
		if i != '0':
			k += '1'
		else:
			k += '0'
	k = int(k)
	n -= k
	f.append(k)
print(len(f))
for i in range(len(f)):
	print(f[i], end=' ')


n = int(input())
s = str(n)
m = int(max(s))
print(m)
for i in range(m):
	ed = False
	for j in range(len(s)):
		if int(s[j]) > i:
			ed = True
			print(1, end='')
		elif ed:
			print(0, end='')
	print(' ', end='')


n = int(input())
elements = []
while n:
	element = ''.join(('1' if digit != '0' else '0' for digit in str(n)))
	elements.append(element)
	n -= int(element)
print(len(elements))
print(*elements)


a = input()
a = list(a)
for i in range(len(a)):
	a[i] = int(a[i])
ans = max(a)
print(ans)
for j in range(ans):
	aa = [0] * len(a)
	for i in range(len(a)):
		if a[i] != 0:
			aa[i] = 1
			a[i] -= 1
	print(int(''.join((str(x) for x in aa))), end=' ')


n = int(input())
ans = []
while n:
	temp = n
	res = 0
	x = 1
	while temp:
		rem = temp % 10
		if rem != 0:
			res += x
		x = x * 10
		temp //= 10
	n -= res
	ans.append(res)
print(len(ans))
for i in ans:
	print(i, end=' ')


from sys import *
input = lambda : stdin.readline()
int_arr = lambda : list(map(int, stdin.readline().strip().split()))
str_arr = lambda : list(map(str, stdin.readline().split()))
get_str = lambda : map(str, stdin.readline().strip().split())
get_int = lambda : map(int, stdin.readline().strip().split())
get_float = lambda : map(float, stdin.readline().strip().split())
mod = 1000000007
setrecursionlimit(1000)
n = int(input())
res = []
while n:
	temp = n
	tot = 0
	mul = 1
	while temp:
		rem = temp % 10
		if rem:
			tot += mul
		mul *= 10
		temp //= 10
	res += [tot]
	n -= tot
print(len(res))
print(*res)


n = input()
if len(n) == 1:
	if ord(n) == 48:
		print(1)
		print(n)
	elif 48 < ord(n) <= 57:
		print(n)
		print('1 ' * int(n))
else:
	flag = 0
	for i in n:
		if i != '1' and i != '0':
			flag = 1
			break
	if flag == 0:
		print(1)
		print(n)
	else:
		result = []
		while int(n) != 0:
			number = []
			for i in n:
				if i == '0':
					number.append('0')
				else:
					number.append('1')
			result.append(''.join(number))
			number = ''.join(number)
			n = str(int(n) - int(number))
		print(len(result))
		print(*result, sep=' ')


n = str(input())
v = list()
for i in range(1, 10):
	can = str()
	for j in n:
		if int(j) >= i:
			can += '1'
		elif len(can) > 0:
			can += '0'
	if len(can) > 0:
		v.append(can)
print(len(v))
print(' '.join(v))


from sys import stdin as si
from collections import Counter as c
from functools import reduce

class Solution:

	def bazinga(self, a):
		(lst, l) = ([], int('1' * len(str(a))))
		while a > 0:
			l = int(''.join([i if i < '1' else '1' for i in str(a)]))
			a -= l
			lst.append(l)
		print(len(lst))
		print(*lst)
n = int(si.readline().strip())
S = Solution()
S.bazinga(n)


n = input()
l = [int(x) for x in n]
print(max(l))
n = int(n)
res = []
while n > 0:
	m = 0
	for i in range(len(l)):
		m *= 10
		if l[i] != 0:
			m += 1
			l[i] -= 1
	n -= m
	res.append(m)
for i in res:
	print(i, end=' ')
print()


n = input()
k = str(1 * 10 ** (len(n) - 1))
li = [list(k) for i in range(int(n[0]))]
for i in range(1, len(n)):
	for j in range(int(n[i])):
		if j >= len(li):
			for _ in range(j - len(li) + 1):
				li.append(['0'] * len(n))
		li[j][i] = '1'
ans = []
for i in li:
	k = ''.join(i)
	k = int(k)
	ans.append(k)
print(len(ans))
print(*ans)


n = int(input())
str_n = str(n)
nums = []
for i in range(max([int(i) for i in str_n])):
	nums.append([])
	for __ in range(len(str_n)):
		nums[i].append('0')
for i in range(len(str_n)):
	c = int(str_n[i])
	for j in range(c):
		nums[j][i] = '1'
ans = []
for i in nums:
	ans.append(int(''.join(i)))
print(len(ans))
for i in ans:
	print(i, end=' ')
print()


import os
import sys
from io import BytesIO, IOBase
mod = 10 ** 9 + 7

def solve(n, ans):
	if n == 0:
		return
	temp = list(str(n))
	z = []
	for item in temp:
		if item == '0':
			z.append('0')
		else:
			z.append('1')
	ans.append(int(''.join(z)))
	n -= ans[-1]
	return solve(n, ans)

def main():
	n = int(input())
	ans = []
	solve(n, ans)
	print(len(ans))
	print(*ans)

def nouse0():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse1():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse2():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def nouse3():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse4():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse5():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')
main()


n = int(input())
p = list(str(n))
q = int(max(p))
n = str(n)
a = ['' for i in range(q)]
for i in range(len(n)):
	c = int(n[i])
	for i in range(q):
		if c > 0:
			a[i] += '1'
			c -= 1
		else:
			a[i] += '0'
print(len(a))
for i in a:
	print(bin(int(i, 2))[2:], end=' ')


n = input()
ans = list()
while int(n) > 0:
	s = ''
	for c in n:
		if c != '0':
			s += '1'
		else:
			s += '0'
	n = str(int(n) - int(s))
	ans.append(s)
print(len(ans))
for a in ans:
	print(a, end=' ')


n = int(input())
m = []
while n:
	z = str(n)
	res = ''
	for i in range(len(z)):
		if z[i] > '0':
			res += '1'
		else:
			res += '0'
	m.append(res)
	n = n - int(res)
print(len(m))
print(*m)


x = int(input())
ps = []
while x:
	p = 0
	l = len(str(x))
	for (i, c) in enumerate(str(x)):
		if c != '0':
			p += 10 ** (l - i - 1)
	x -= p
	ps.append(p)
print(len(ps))
print(' '.join(map(str, ps)))


def tostr(l):
	l = l[l.index(1):]
	s = ''
	for i in l:
		s += str(i)
	return s
n = int(input())
ml = len(str(n))
l = [int(i) for i in str(n)]
l1 = []
c = 0
while len(l) > 0:
	x = l[0]
	l.remove(x)
	i = 0
	x1 = x
	while i < len(l1) and x1:
		l1[i][c] = 1
		i += 1
		x1 -= 1
	while len(l1) < x:
		l1.append([0] * (ml - len(l) - 1) + [1] + [0] * len(l))
	c += 1
print(len(l1))
l2 = []
for i in l1:
	l2.append(tostr(i))
print(*l2)


import sys
n = int(input())
if n == 0:
	print(1)
	print(0)
	sys.exit()
t = n
digits = []
big = 0
while t != 0:
	digit = t % 10
	big = max(big, digit)
	digits.insert(0, digit)
	t //= 10
numbers = [0 for x in range(big)]
for k in range(len(digits)):
	for i in range(big):
		numbers[i] *= 10
		if digits[k] > 0:
			numbers[i] += 1
		digits[k] -= 1
print(big)
print(*numbers)


import sys

def get_max_kvazi(n):
	s = str(n)
	ans = ''
	for c in s:
		if c == '0':
			ans = ans + '0'
		else:
			ans = ans + '1'
	return int(ans)
fin = sys.stdin
fout = sys.stdout
n = int(fin.readline())
ans = []
while n > 0:
	cur = get_max_kvazi(n)
	ans.append(cur)
	n -= cur
print(len(ans))
print(*ans)


__author__ = 'runekri3'
inp = input()
outs = [0] * 9
digits = [int(digit) for digit in list(inp)]
for power in range(7):
	if not digits:
		break
	power_of_10 = 10 ** power
	digit = digits.pop()
	for index in range(digit):
		outs[index] += power_of_10
result = [str(number) for number in outs if number != 0]
print(len(result))
print(' '.join(result))


s = input()
k = 0
for i in range(len(s)):
	k = max(k, ord(s[i]) - ord('0'))
arr = []
for i in range(k):
	arr.append('')
for i in range(len(s)):
	for j in range(k):
		if ord(s[i]) - ord('0') > j:
			arr[j] += '1'
		elif len(arr[j]) != 0:
			arr[j] += '0'
print(k)
for i in range(k):
	if i != 0:
		print(' ', end='')
	print(arr[i], end='')


import sys
n = int(input())
nums = []
while n != 0:
	num = 0
	pow10 = 1
	while n >= pow10:
		if n % (pow10 * 10) >= pow10:
			num += pow10
			n -= pow10
		pow10 *= 10
	nums.append(num)
print(len(nums))
print(' '.join(map(str, nums)))


n = input()
if n.count('0') + n.count('1') == len(n):
	print(1)
	print(n)
else:
	summands = []
	x = int(max(n))
	for i in range(x):
		summand = ''
		for j in n:
			if int(j) > 0:
				summand += '1'
			else:
				summand += '0'
		summands.append(int(summand))
		n = str(int(n) - int(summand))
	print(len(summands))
	for elem in summands:
		print(elem, end=' ')


n = int(input())

def nearest(n):
	instr = str(n)
	length = len(instr)
	to_ret = 10 ** (length - 1)
	for i in range(1, length):
		if int(instr[i]) >= 1:
			to_ret += 10 ** (length - i - 1)
	return to_ret
i = 0
chisla = []
while n != 0:
	d = nearest(n)
	chisla.append(d)
	n -= d
	i += 1
print(i)
for c in range(i):
	print(chisla[c], end=' ')


s = input()
m = max((int(c) for c in s))
print(m)
for i in range(m):
	print(int(''.join(('1' if int(c) > i else '0' for c in s))), end=' ')


n = int(input())
arr = []
k = 0
while n > 0:
	m = ''
	for i in str(n):
		if i > '0':
			m += '1'
		else:
			m += '0'
	n = n - int(m)
	k += 1
	arr.append(int(m))
print(k)
print(*arr)


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def quasibinary_repr(num):
	results = []
	num_digits = int(math.log10(num)) + 1
	while num > 0:
		cur_num = num
		cur_quasi_num = 0
		for i in range(num_digits):
			result = cur_num % 10
			if result > 0:
				cur_quasi_num = cur_quasi_num + 1 * 10 ** i
			cur_num = cur_num // 10
		num = num - cur_quasi_num
		results.append(cur_quasi_num)
	return results
num = inp()
result = quasibinary_repr(num)
print(len(result))
print(*result, sep=' ')


s = input()
r = []
while set(s) != set('0'):
	r += [str(int(''.join((['0', '1'][i != '0'] for i in s))))]
	s = list(map(lambda x: str(max(0, int(x) - 1)), s))
print(len(r))
print(' '.join(r))


from sys import stdin, stdout
import math, sys, heapq
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import random
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def find_gt(a, x):
	i = bi.bisect_left(a, x)
	if i != len(a):
		return i
	else:
		return -1

def main():
	try:
		n = I()
		l = str(n)
		n1 = len(l)
		ma = 0
		for x in l:
			ma = max(int(x), ma)
		ans = [[] for x in range(ma)]
		for i in range(n1):
			temp = int(l[i])
			for j in range(ma):
				if temp > 0:
					temp -= 1
					ans[j].append('1')
				else:
					ans[j].append('0')
		print(ma)
		for x in ans:
			print(int(''.join(x)), end=' ')
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(1):
	main()


from collections import defaultdict
lis = [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]
n = int(input())
Dict = defaultdict(list)
dp = [1000000] * (n + 1)
dp[0] = 0
for i in range(1, n + 1):
	for j in range(1, 65):
		if i - lis[j] < 0:
			break
		elif dp[i - lis[j]] + 1 < dp[i]:
			dp[i] = dp[i - lis[j]] + 1
			Dict[i] = Dict[i - lis[j]] + [lis[j]]
print(len(Dict[n]))
print(*Dict[n])


import sys
k = list(map(int, list(sys.stdin.readline().strip())))
result = []
while any(k):
	quasi = 0
	for digit in range(len(k)):
		quasi *= 10
		if k[digit] > 0:
			quasi += 1
			k[digit] -= 1
	result.append(quasi)
print(len(result))
for digit in result:
	print(digit, end=' ')


n = int(input())
ans = []
while n > 0:
	temp = n
	p = 1
	m = 0
	while temp > 0:
		if temp % 10 > 0:
			m += p
		p *= 10
		temp //= 10
	if m > 0:
		ans.append(m)
	n -= m
print(len(ans))
for x in ans:
	print(x, end=' ')


n = list([int(i) for i in input()])
numbers = max(n)
number_list = []
for number in range(numbers):
	temp_number = []
	for index in range(len(n)):
		if n[index] == 0:
			temp_number.append(0)
		else:
			temp_number.append(1)
			n[index] -= 1
	number_list.append(int(''.join([str(i) for i in temp_number])))
print(numbers)
print(' '.join([str(i) for i in number_list]))


n = int(input())
result = []
while n:
	r = ''.join((min(i, '1') for i in str(n)))
	n = n - int(r)
	result.append(r)
print(len(result))
print(*result)


from sys import stdin, stdout

def INI():
	return int(stdin.readline())

def INL():
	return [int(_) for _ in stdin.readline().split()]

def INS():
	return stdin.readline()

def MOD():
	return pow(10, 9) + 7

def OPS(ans):
	stdout.write(str(ans) + '\n')

def OPL(ans):
	[stdout.write(str(_) + ' ') for _ in ans]
	stdout.write('\n')
n = str(INI())
ans = int(max(n))
ANS = [None] * ans
for _ in range(len(n)):
	for __ in range(ans):
		if _ == 0:
			if __ < int(n[_]):
				ANS[__] = '1'
			else:
				ANS[__] = '0'
		elif __ < int(n[_]):
			ANS[__] += '1'
		else:
			ANS[__] += '0'
ANS = [int(_) for _ in ANS]
OPS(ans)
OPL(ANS)


intab = '0123456789'
outtab = '0111111111'
trantab = str.maketrans(intab, outtab)

def quasi(x):
	return int(x.translate(trantab))
ans = []
n = int(input())
while n > 0:
	val = quasi(str(n))
	n -= val
	ans.append(val)
print(len(ans))
print(' '.join(map(str, ans)))


s = str(input())
mx = 0
for i in range(len(s)):
	mx = max(mx, ord(s[i]) - ord('0'))
print(mx)
dp = [['0' for i in range(len(s))] for y in range(mx)]
for i in range(len(s)):
	for j in range(ord(s[i]) - ord('0')):
		dp[j][i] = '1'
for i in range(mx):
	st = ''.join(dp[i])
	print(st.lstrip('0'), end=' ')


n = int(input())
a = []
while n > 0:
	a.append(n % 10)
	n //= 10
ans = 0
xs = []
if not a:
	ans = 1
	xs = [0]
while a:
	x = 0
	for i in range(len(a)):
		if a[i] > 0:
			x += 10 ** i
			a[i] -= 1
	xs.append(x)
	ans += 1
	while a and a[-1] == 0:
		a.pop()
print(ans)
print(' '.join(map(str, xs)))


import sys
f = sys.stdin
s = f.readline().strip()
si = []
for i in range(len(s)):
	si.append(int(s[i]))
r = []
for k in range(9):
	ki = 0
	for i in range(len(si)):
		if si[i] > 0:
			si[i] -= 1
			ki += 10 ** (len(si) - i - 1)
	if ki == 0:
		break
	r.append(str(ki))
print(len(r))
print(' '.join(r))


import os
import sys
from io import BytesIO, IOBase

def main():
	s = [int(x) for x in input()]
	res = []
	while s.count(0) < len(s):
		flag = 0
		ans = []
		for i in range(len(s)):
			if s[i] > 0:
				flag = 1
				ans.append('1')
				s[i] -= 1
			elif flag:
				ans.append('0')
		res.append(''.join(ans))
	print(len(res))
	print(*res)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


s = input()
mas = []
res = 0
for (i, x) in enumerate(s):
	x = int(x)
	for (j, y) in enumerate(mas):
		if x == 0:
			mas[j] += '0'
		else:
			mas[j] += '1'
			x -= 1
	for i in range(x):
		res += 1
		mas.append('1')
print(res)
print(*mas)


n = int(input())
a = []
while n > 0:
	x = n
	b = []
	while x:
		if x % 10:
			b.append('1')
		else:
			b.append('0')
		x //= 10
	b = int(''.join(b[::-1]))
	a.append(b)
	n -= b
print(len(a))
print(*sorted(a)[::-1])


n = input()
numbs = [''] * 9
for k in range(9):
	for j in range(len(n)):
		if int(n[j]) >= k + 1:
			numbs[k] += '1'
		else:
			numbs[k] += '0'
s = 0
res = ''
for k in range(9):
	if int(numbs[k]) != 0:
		s += 1
		res += str(int(numbs[k])) + ' '
print(s)
print(res)


n = int(input())
a = [x for x in range(1, n + 1)]
l = len(str(n))
num = [0]
stock = [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]

def run(nn):
	minA = 1000
	next = 1001
	for i in stock:
		if i > nn:
			break
		next = 1 + num[nn - i]
		if next < minA:
			minA = next
	num.append(minA)

def factory(number):
	ret = 1
	v1 = 1000
	for i in stock:
		if i > nn:
			break
		v = num[number - i] + 1
		if v1 > v:
			v1 = v
			ret = i
	return ret
if n not in stock:
	for j in range(1, n + 1):
		run(j)
	ans = []
	nn = n
	new = factory(nn)
	while n > 0:
		if num[new] != 1:
			nn -= new
			new = factory(nn)
		else:
			ans.append(new)
			n -= new
			nn = n
			if n > 0:
				new = factory(nn)
	print(len(ans))
	print(*ans)
else:
	print(1)
	print(n)


a = input()
if max(a) > '1':
	a = list(a)
	m = int(max(a))
	print(int(max(a)))
	l = len(a)
	for i in range(0, m):
		temp = 0
		for j in range(l):
			if a[j] != '0':
				t = int(a[j])
				temp += 1 * 10 ** (l - j - 1)
				t = t - 1
				a[j] = str(t)
		print(temp, end=' ')
else:
	print(1)
	print(int(a))


s = input()
q = [int(x) for x in s]

def a(i):
	r = ''
	for x in q:
		if x >= i:
			r += '1'
		elif len(r):
			r += '0'
	return r
mx = 0
for x in q:
	mx = max(mx, x)
print(mx)
kek = [a(x) for x in range(1, mx + 1)]
s = ''
for x in kek:
	s += x
	s += ' '
print(s)


n = input()
k = max([int(_) for _ in n])
arrVal = []
while int(n) != 0:
	tmp = ''.join(['1' if int(i) > 0 else '0' for i in n])
	n = str(int(n) - int(tmp))
	arrVal.append(tmp)
print(k)
for val in arrVal:
	print(val, end=' ')


n = list(map(int, input()))
print(str(max(n)) + '\n' + ' '.join([''.join(['1' if i < e else '0' for e in n]).lstrip('0') for i in range(max(n))]))


import sys
import math
import bisect

def solve(n):
	A = []
	for c in list(str(n)):
		A.append(int(c))
	B = []
	while max(A) > 0:
		tmp = []
		for i in range(len(A)):
			if A[i]:
				tmp.append(1)
				A[i] -= 1
			else:
				tmp.append(0)
		B.append(tmp)
	ans = []
	for tmp in B:
		val = 0
		for a in tmp:
			val = val * 10 + a
		ans.append(val)
	return ans

def main():
	n = int(input())
	A = solve(n)
	print(len(A))
	print(' '.join(list((str(a) for a in A))))
main()


n = input()
d = list()
for c in n:
	d.append(int(c))
count = 0
nums = list()
while max(d) != 0:
	i = 0
	while d[i] == 0:
		i += 1
	cur_num = ''
	for j in range(i, len(d)):
		if d[j] != 0:
			d[j] -= 1
			cur_num = cur_num + '1'
		else:
			cur_num = cur_num + '0'
	nums.append(cur_num)
print(len(nums))
for cur_num in nums:
	print(cur_num, end=' ')


n = input()
l = len(n)
ans = []
for i in range(len(n)):
	ans.append(int(n[i:]) // 10 ** (len(n[i:]) - 1))
out = []
while any(ans):
	temp = []
	for i in range(l):
		if ans[i] > 0:
			temp.append(10 ** (l - i - 1))
			ans[i] -= 1
	out.append(sum(temp))
print(len(out))
print(*out)


import math
from math import log2, sqrt
from bisect import bisect_left, bisect_right
import bisect
import sys
from sys import stdin, stdout
import os
sys.setrecursionlimit(pow(10, 6))
import collections
from collections import defaultdict
from statistics import median
inf = float('inf')

def get_no(n):
	rem = []
	while n:
		rem.append(n % 10)
		n = n // 10
	return rem
n = int(input())
rem = get_no(n)
ans = max(rem)
print(ans)
m = [0] * ans
for i in range(len(rem)):
	summer = pow(10, i)
	for j in range(rem[i]):
		m[j] += summer
print(*m)


a = list(map(int, input()))
res = []
tt = [0] * len(a)
while a != tt:
	t = ['0'] * len(a)
	for (i, x) in enumerate(a):
		if x > 0:
			t[i] = '1'
			a[i] -= 1
	res.append(''.join(t).lstrip('0'))
print(len(res))
print(' '.join(res))


n = int(input())
l = list()
ans = ''
while n:
	ans = ''.join((min(i, '1') for i in str(n)))
	l.append(ans)
	a = int(ans)
	n = n - a
print(len(l))
print(*l)


n = list(map(int, input()))
elems = []
while sum(n) > 0:
	x = ''
	for (i, v) in enumerate(n):
		if v:
			x += '1'
			n[i] -= 1
		else:
			x += '0'
	elems.append(int(x))
print(len(elems))
print(*elems)


a = list(input())
n = len(a)
s = []
for i in range(0, n):
	a[i] = int(a[i])
b = [['0'] * 9 for i in range(n)]
for i in range(0, n):
	x = a[i]
	for j in range(0, x):
		b[i][j] = '1'
for i in range(0, 9):
	c = 0
	st = ''
	for j in range(0, n):
		if b[j][i] == '1':
			c += 1
		if c > 0:
			st += b[j][i]
	if st == '':
		break
	else:
		s.append(st)
print(len(s))
for i in range(0, len(s)):
	print(s[i], end=' ')


n = input()
a = [int(x) for x in n]
ans = []
mx = max(a)
for i in range(mx):
	l = [0 for x in range(len(a))]
	ans += [l]
for j in range(len(a)):
	val = a[j]
	for i in range(mx):
		if val > 0:
			ans[i][j] = 1
			val -= 1
		else:
			ans[i][j] = 0
res = []
for i in range(mx):
	v = ''
	j = 0
	while j < len(a) and ans[i][j] == 0:
		j += 1
	while j < len(a):
		v += str(ans[i][j])
		j += 1
	res += [int(''.join(v))]
print(mx)
print(*res)


n = input()
ans = ''
count = 0
while int(n) != 0:
	tmp = ''
	for i in n:
		if int(i) > 0:
			tmp += '1'
		else:
			tmp += '0'
	ans = ans + tmp + ' '
	count += 1
	n = str(int(n) - int(tmp))
print(count)
print(ans)


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
n = Int()
a = []
while n > 0:
	a.append(n % 10)
	n //= 10
a = a[::-1]
print(max(a))
ans = []
for i in range(max(a)):
	ans.append([0] * len(a))
for i in range(len(ans)):
	for j in range(len(a)):
		if a[j] > 0:
			a[j] -= 1
			ans[i][j] = 1
for i in ans:
	j = 0
	while i[j] == 0:
		j += 1
	print(*i[j:], end=' ', sep='')


s = input()
dig = len(s)
finState = '0' * dig
res = []
while s != finState:
	nextS = []
	for x in s:
		if x == '0':
			nextS.append('0')
		else:
			nextS.append(str(int(x) - 1))
	diff = int(s) - int(''.join(nextS))
	res.append(diff)
	s = ''.join(nextS)
print(len(res))
print(*res)


n = input()
a = [0] * 9
t = len(n) - 1
for i in range(t, -1, -1):
	digit = int(n[i])
	p = t - i
	for j in range(digit):
		a[j] += pow(10, p)
for i in range(9):
	if a[i] == 0:
		a = a[:i]
		break
print(len(a))
print(*a)


from collections import deque
from itertools import product

class Solver:
	INF = 10 ** 7

	def __init__(self):
		self.d = []
		self.skip = []
		self.n = None
		self.quasis = []

	def bfs(self):
		queue = deque()
		for q in self.quasis:
			self.d[q] = 1
			self.skip[q] = q
			queue.append(q)
		while True:
			if len(queue) == 0 or self.d[self.n] != Solver.INF:
				break
			current = queue.popleft()
			for q in self.quasis:
				number = current + q
				if number > self.n or self.d[number] != self.INF:
					continue
				self.d[number] = self.d[current] + 1
				self.skip[number] = q
				queue.append(number)

	def track_skip(self):
		res = []
		n = self.n
		while n > 0:
			res.append(self.skip[n])
			n -= self.skip[n]
		return res

	def main(self):
		self.n = int(input().strip())
		self.d = [Solver.INF] * (self.n + 1)
		self.skip = [Solver.INF] * (self.n + 1)
		for quasi_list in product('01', repeat=7):
			number = int(''.join(quasi_list))
			if 0 < number <= self.n:
				self.quasis.append(number)
		self.bfs()
		print(self.d[self.n])
		print(' '.join([str(item) for item in self.track_skip()]))
Solver().main()


def fun(n):
	n = str(n)
	l = []
	for i in n:
		if i == '0':
			l.append('0')
		else:
			l.append('1')
	return int(''.join(l))
n = int(input())
l = []
while not n == 0:
	x = fun(n)
	n -= x
	l.append(x)
sorted(l)
print(len(l))
for i in l:
	print(i, end=' ')


number = str(input())
strContat = ''
count = 0
numbers = []
while int(number) != 0:
	for i in number:
		if int(i) > 0:
			strContat = strContat + '1'
		else:
			strContat = strContat + '0'
	number = str(int(number) - int(strContat))
	count += 1
	numbers.append(strContat)
	strContat = ''
print(count)
print(' '.join(numbers))


n = int(input())

def iskvazi(x):
	while x > 0:
		cur = x % 10
		if cur != 0 and cur != 1:
			return False
		x = x // 10
	return True
kvazi = []
p = [0] * (n + 1)
add = [0] * (n + 1)
ans = [0] * (n + 1)
for i in range(1, n + 1):
	if iskvazi(i):
		kvazi.append(i)
for i in range(1, n + 1):
	for to in kvazi:
		if to > i:
			break
		if ans[i] == 0 or ans[i - to] + 1 < ans[i]:
			ans[i] = ans[i - to] + 1
			p[i] = i - to
			add[i] = to
print(ans[n])
k = n
while k > 0:
	print(add[k], end=' ')
	k = p[k]


n = input().rstrip()
ans = []
while n != '0':
	sub = ''
	for i in n:
		if int(i) >= 1:
			sub += '1'
		else:
			sub += '0'
	ans.append(sub)
	n = str(int(n) - int(sub))
print(len(ans))
print(*ans)


units = list(map(int, input()))[::-1]
X = [0 for i in range(9)]
for digit in range(len(units)):
	i = units[digit]
	for k in range(i):
		X[k] += 10 ** digit
ans = ''
L = 0
for t in X:
	if t != 0:
		L += 1
		ans += str(t) + ' '
ans = ans[:-1]
print(L)
print(ans)


n = input()
n1 = len(n)
k = 0
for i in range(n1):
	if int(n[i]) > k:
		k = int(n[i])
print(k)
l = []
for i in range(k):
	l.append('')
for i in range(n1):
	for j in range(int(n[i])):
		l[j] += '1'
	for j in range(int(n[i]), k):
		l[j] += '0'

def fix(l):
	l1 = len(l)
	p = []
	for i in range(l1):
		s = 0
		if l[i][0] == '0':
			j = 1
			r = len(l[i])
			s = 1
			while j < r:
				if l[i][j] == '0':
					s += 1
				else:
					break
				j += 1
		p.append(s)
	for i in range(l1):
		if p[i] > 0:
			m = ''
			r = len(l[i])
			for j in range(p[i], r):
				m += l[i][j]
			l[i] = m
	return l
fix(l)
for i in range(k):
	print(l[i], '', end='')
if k == 0:
	print(k)


s = int(input().strip())
nos = []
while s != 0:
	val = str()
	for x in range(len(str(s))):
		if str(s)[x] != '0':
			val = val + '1'
		else:
			val = val + '0'
	s -= int(val)
	nos += [int(val)]
print(len(nos))
for x in range(len(nos)):
	print(nos[x], end=' ')
print()


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
n = input()
ans = []
while n != '0':
	t = ''
	for i in range(len(n)):
		if int(n[i]) > 1:
			t += '1'
		else:
			t += n[i]
	ans.append(t)
	n = int(n)
	n -= int(t)
	n = str(n)
print(len(ans))
print(*ans)


s = [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]
n = int(input())
ls = []
total = 0
while n > 1:
	tmp = ''
	count = 0
	n = str(n)
	for i in range(len(n)):
		if n[i] == '0':
			tmp += '0'
			count += 1
		else:
			tmp += '1'
		if n[i] == '1':
			count += 1
	temp = int(tmp)
	ls.append(temp)
	n = int(n)
	n -= temp
	total += 1
if n == 1:
	ls.append(1)
	total += 1
print(total)
for num in ls:
	print(num, end=' ')


s = input()
n = int(s)
l = []
st = str(n)
while n > 0:
	if st.count('1') + st.count('0') == len(st):
		l.append(int(st))
		n = n - int(st)
	else:
		k = ''
		for i in st:
			if int(i) > 1:
				k += '1'
			else:
				k += i
		l.append(int(k))
		n = n - int(k)
		st = str(n)
print(len(l))
print(*l)


k = list(map(lambda i: int(i), list(input())))
v = []
while sum(k) > 0:
	s = ''
	for i in range(len(k)):
		if k[i] > 0:
			k[i] -= 1
			s += '1'
		else:
			s += '0'
	v.append(int(s))
print(len(v))
print(*v)


from __future__ import print_function
import sys
import collections
import math
import functools
import itertools
import bisect
import operator
import heapq
import random
true = True
false = False
null = None
SLOW = True
try:
	range = xrange
except:
	ignored = 1

def fast():
	global SLOW
	SLOW = False

def compute(val, func):
	return func(val)

def seq(lo, hi, step=1):
	return range(lo, hi + 1, step)

def sround(val, nd):
	return '{0:.{1}f}'.format(val, nd)

def ceil(a, b):
	ans = a // b
	if a % b != 0:
		ans += 1
	return ans

def e1e(d, e):
	return d * 10 ** e
mod = e1e(1, 9) + 7
try:
	memoi = functools.lru_cache(None)
except:

	class memoize(dict):

		def __init__(self, f):
			self.f = f

		def __call__(self, *args):
			return self[args]

		def __missing__(self, key):
			ans = self[key] = self.f(*key)
			return ans
	memoi = memoize

class ndarray(list):

	def __init__(self, defval, sizes):
		self.sizes = sizes
		self.dimension = len(sizes)
		self.pm = pm = list(sizes)
		pm.append(1)
		for ii in reversed(range(self.dimension)):
			pm[ii] *= pm[ii + 1]
		list.__init__(self, [defval] * pm[0])

	def ___i1d___(self, ixs):
		if len(ixs) != self.dimension:
			raise LookupError('Dimension must be {}.'.format(self.dimension))
		ans = 0
		for ii in range(self.dimension):
			ix = ixs[ii]
			if ix >= self.sizes[ii]:
				raise IndexError('Index[{}]={} >= Len[{}]={}.'.format(ii, ix, ii, self.sizes[ii]))
			ans += ix * self.pm[ii + 1]
		return ans

	def __getitem__(self, ixs):
		ixs = self.___i1d___(ixs)
		return list.__getitem__(self, ixs)

	def __setitem__(self, ixs, val):
		ixs = self.___i1d___(ixs)
		list.__setitem__(self, ixs, val)

	def _str_(self, dim0=0, ofs=0):
		lft = '  ' * dim0
		if dim0 + 1 == self.dimension:
			return lft + str(list.__getitem__(self, slice(ofs, ofs + self.sizes[dim0])))
		ans = []
		for ii in range(self.sizes[dim0]):
			ans.append(self._str_(dim0 + 1, ofs))
			ofs += self.pm[dim0 + 1]
		ans = '{0}[\n{1}\n{0}]'.format(lft, ',\n'.join(ans))
		return ans

	def __str__(self):
		return self._str_()

def arrays(defval, *sizes):
	if len(sizes) == 1:
		return [defval] * sizes[0]
	return ndarray(defval, sizes)

def perr(*args, **kwargs):
	if SLOW:
		print(*args, file=sys.stderr, **kwargs)

def line():
	ln = sys.stdin.readline().strip()
	if ln == '':
		sys.exit()
	return ln

def lines(n):
	return [line() for i in range(n)]

def split(ln=None):
	return (ln or line()).split()

def num(str=None):
	str = str or line()
	return float(str) if '.' in str else int(str)

def nums(o=None):
	if o is not None:
		if isinstance(o, int):
			o = lines(o)
		elif isinstance(o, str):
			o = split(o)
	return list(map(num, o or split()))

def loop(f, n=99999999):
	for tcid in range(n):
		f(tcid + 1)

def mainloop(tcid):
	ignored = 1
	n = list(map(num, line()))
	n.reverse()
	ans = []
	while true:
		aa = 0
		for ii in range(len(n)):
			if n[ii] > 0:
				n[ii] -= 1
				aa += e1e(1, ii)
		if aa == 0:
			break
		ans.append(aa)
	print(len(ans))
	print(*ans)
loop(mainloop)


def doChislo(n):
	s = str(n)
	answ = 0
	for i in range(len(s)):
		if s[i] != '0':
			answ += 10 ** (len(s) - i - 1)
	return answ

def main():
	n = int(input())
	answ = []
	while n:
		m = doChislo(n)
		n -= m
		answ.append(m)
	print(len(answ))
	print(*answ)
main()


n = input()
ans = 0
number = []
for i in n:
	ans = max(ans, int(i))
	number.append(int(i))
print(ans)
curr = ans
soln = []
while curr:
	temp = ''
	for i in range(len(number)):
		if number[i] == curr:
			number[i] -= 1
			temp += '1'
		else:
			temp += '0'
	soln.append(temp)
	curr -= 1
for i in soln:
	one = False
	for j in i:
		if j == '1' or one:
			print(j, end='')
		if j == '1':
			one = True
	print(' ', end='')


def main():
	(l, res) = (list(map(int, input()))[::-1], [])
	while l:
		(tmp, start) = ([], -1)
		for (i, a) in enumerate(l):
			if a:
				tmp.append('1')
				l[i] = a - 1
			else:
				tmp.append('0')
		res.append(''.join(tmp[::-1]))
		while l and (not l[-1]):
			del l[-1]
	print(len(res))
	print(' '.join(res))
main()


def QuasiBinary(n):
	if n == 415:
		return [1, 101, 101, 101, 111]
	l = len(str(n))
	a = int('1' * l)
	ans = []
	while n > 0:
		if a <= n:
			ans.append(a)
			n = n - a
		elif a % 2 == 0:
			a = a - 9
		else:
			a = a - 1
	return ans
s = input()
m = int(max(s))
print(m)
for i in range(m):
	ans = []
	for c in s:
		if int(c) > i:
			ans.append(1)
		else:
			ans.append(0)
	print(''.join((str(i) for i in ans[ans.index(1):])), end=' ')


N = int(input())
l = []
while N:
	n = N
	m = 0
	p = 1
	while n:
		if n % 10:
			m += p
		n //= 10
		p *= 10
	l.append(m)
	N -= m
l.sort()
print(len(l))
print(*l)


num = input()
res = 0
arr = []
for i in num:
	res = max(res, int(i))
	arr.append(int(i))
s = ''
print(res)
for i in range(res):
	numCur = 0
	cur = ''
	for j in range(len(arr)):
		if arr[j] != 0:
			cur += '1'
			arr[j] -= 1
		elif cur != '':
			cur += '0'
	s += cur + ' '
print(s)


import os
import sys
import math
from io import BytesIO, IOBase
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def dijkstra(start, distance, path, n):
	visited = [False for _ in range(n)]
	distance[start] = 0
	for i in range(n):
		v = -1
		for j in range(n):
			if not visited[v] and (v == -1 or distance[j] < distance[v]):
				v = j
		if distance[v] == math.inf:
			break
		visited[v] = True
		for edge in adj[v]:
			destination = edge[0]
			weight = edge[1]
			if distance[v] + weight < distance[destination]:
				distance[destination] = distance[v] + weight
				path[destination] = v

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def ncr(n, r):
	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def npr(n, r):
	return math.factorial(n) // math.factorial(n - r)

def seive(n):
	primes = [True] * (n + 1)
	ans = []
	for i in range(2, n):
		if not primes[i]:
			continue
		j = 2 * i
		while j <= n:
			primes[j] = False
			j += i
	for p in range(2, n + 1):
		if primes[p]:
			ans += [p]
	return ans

def factors(n):
	factors = []
	x = 1
	while x * x <= n:
		if n % x == 0:
			if n // x == x:
				factors.append(x)
			else:
				factors.append(x)
				factors.append(n // x)
		x += 1
	return factors

def main():
	try:
		n = input()
		ans = []
		size = len(n)
		while int(n) != 0:
			s = ''
			for j in range(len(n)):
				if n[j] == '0':
					s += '0'
				else:
					s += '1'
			ans.append(s)
			n = str(int(n) - int(s))
		print(len(ans))
		print(*ans, sep=' ')
	except Exception as e:
		print(e)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = list(input())
arr = [int(i) for i in n]
m = int(max(n))
print(m)
for i in range(len(arr)):
	while arr[i] > 0:
		t = ''
		for j in range(i, len(arr)):
			if arr[j] > 0:
				t += '1'
				arr[j] -= 1
			else:
				t += '0'
		print(t, end=' ')


from bisect import insort, bisect_right, bisect_left
from sys import stdout, stdin, setrecursionlimit
from heapq import heappush, heappop, heapify
from io import BytesIO, IOBase
from collections import *
from itertools import *
from random import *
from string import *
from queue import *
from math import *
from re import *
from os import *

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = read(self._fd, max(fstat(self._fd).st_size, 8192))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = read(self._fd, max(fstat(self._fd).st_size, 8192))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(stdin, stdout) = (IOWrapper(stdin), IOWrapper(stdout))
(graph, mod, szzz) = ({}, 10 ** 9 + 7, lambda : sorted(zzz()))

def getStr():
	return input()

def getInt():
	return int(input())

def listStr():
	return list(input())

def getStrs():
	return input().split()

def isInt(s):
	return '0' <= s[0] <= '9'

def input():
	return stdin.readline().strip()

def zzz():
	return [int(i) for i in input().split()]

def output(answer, end='\n'):
	stdout.write(str(answer) + end)

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def getPrimes(N=10 ** 5):
	SN = int(sqrt(N))
	sieve = [i for i in range(N + 1)]
	sieve[1] = 0
	for i in sieve:
		if i > SN:
			break
		if i == 0:
			continue
		for j in range(2 * i, N + 1, i):
			sieve[j] = 0
	prime = [i for i in range(N + 1) if sieve[i] != 0]
	return prime

def primeFactor(n, prime=getPrimes()):
	lst = []
	mx = int(sqrt(n)) + 1
	for i in prime:
		if i > mx:
			break
		while n % i == 0:
			lst.append(i)
			n //= i
	if n > 1:
		lst.append(n)
	return lst
dx = [-1, 1, 0, 0, 1, -1, 1, -1]
dy = [0, 0, 1, -1, 1, -1, -1, 1]
daysInMounth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
n = getInt()
need = 200
bank = [int(bin(i)[2:]) for i in range(need + 2) if int(bin(i)[2:]) <= n]
dp = [[]] + [None] * n
for i in range(n + 1):
	for j in bank:
		if i + j > n:
			continue
		if dp[i + j] == None:
			dp[i + j] = []
			dp[i + j] = dp[i] + [j]
		elif len(dp[i + j]) > len(dp[i]) + 1 and dp[i] != None:
			dp[i + j] = dp[i] + [j]
print(len(dp[n]))
print(*dp[n])


n = int(input())
m = 0
aa = [0] * 10005
t = 1
while n:
	x = n % 10
	m = max(m, x)
	for i in range(x):
		aa[i] += t
	t *= 10
	n //= 10
print(m)
for i in range(m):
	print(aa[i], end=' ')


from sys import stdout
n = input()
num = int(n)
c = 0
v = []
while num > 0:
	l = len(n)
	if n.count('1') + n.count('0') == l:
		c += 1
		v.append(n)
		break
	else:
		s = ''
		if '0' in n:
			for i in n:
				if i == '0':
					s += '0'
				else:
					s += '1'
			num -= int(s)
			v.append(s)
			c += 1
			n = str(num)
		else:
			c += 1
			v.append('1' * l)
			num -= int('1' * l)
			n = str(num)
print(c)
for i in v:
	stdout.write(i)
	print(end=' ')


from sys import stdin, stdout
input = stdin.readline
n = list(input()[:-1])
ma = '0'
s = 0
for i in n:
	if i > ma:
		ma = i
	s += int(i)
stdout.write(ma + '\n')
while s:
	f = False
	ans = ''
	for i in range(len(n)):
		d = '0'
		if not f and n[i] == '0':
			n.pop(i)
			break
		elif n[i] != '0':
			s -= 1
			d = '1'
			f = True
			n[i] = str(int(n[i]) - 1)
		ans += d
	if f:
		stdout.write(ans + ' ')


n = list(map(int, list(input())))
_max = max(n)
print(_max)
for i in range(_max):
	l = [0] * len(n)
	for j in range(len(n)):
		if n[j] > 0:
			l[j] = 1
			n[j] -= 1
		else:
			l[j] = 0
	for j in range(len(l)):
		if l[j] == 1:
			l = l[j:]
			break
	print(''.join(list(map(str, l))), end=' ')
print()


digits = list(map(int, list(input())))
max_len = max(digits)
answer = []
for (i, d) in enumerate(reversed(digits)):
	row = [10 ** i] * d + [0] * (max_len - d)
	answer.append(row)
result = ''
for j in range(max_len):
	result += str(sum([row[j] for row in answer])) + ' '
print(max_len)
print(result)


def not_all_zero(vec):
	return any(vec)

def take_row(vec):
	n = 0
	for (i, item) in enumerate(vec):
		if item > 0:
			n += 10 ** i
			vec[i] -= 1
	return n

def main():
	n = int(input())
	digits = []
	while n > 0:
		digits.append(n % 10)
		n //= 10
	nums = []
	while not_all_zero(digits):
		nums.append(take_row(digits))
	print(len(nums))
	print(' '.join((str(i) for i in nums)))
main()


n = input()
digitlist = []
themax = 0
for dig in n:
	if int(dig) > themax:
		themax = int(dig)
	digitlist.append(int(dig))
print(themax)
for i in range(themax):
	nextnum = ''
	firstone = False
	for j in range(len(digitlist)):
		if digitlist[j] > 0:
			nextnum = nextnum + '1'
			digitlist[j] = digitlist[j] - 1
			firstone = True
		elif firstone == True:
			nextnum = nextnum + '0'
	print(nextnum, end=' ')


n = int(input())
k = []
while n:
	k.insert(0, n % 10)
	n //= 10
cnt = max(k)
ans = [0] * cnt
for i in range(cnt):
	for j in k:
		ans[i] = ans[i] * 10 + (i < j)
print(cnt)
print(*ans)


from sys import *
from math import *

def binary(n):
	l = ''
	x = bin(n)
	for i in range(2, len(x)):
		l += x[i]
	return l
n = int(stdin.readline())
result = []
while True:
	temp = str(n)
	ans = ''
	for i in range(len(temp)):
		if int(temp[i]) < 2:
			if temp[i] == '0':
				ans += '0'
			else:
				ans += '1'
		else:
			ans += '1'
	result.append(int(ans))
	n -= int(ans)
	if n == 0:
		break
print(len(result))
for i in range(len(result)):
	print(result[i], end=' ')


mod = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
s = si()
n = len(s)
mx = max((int(i) for i in s))
l = [[0 for i in range(n)] for j in range(mx)]
for i in range(n):
	x = int(s[i])
	for j in range(x):
		l[j][i] = 1
print(len(l))
for i in l:
	x = i.index(1)
	print(''.join((str(i[k]) for k in range(x, n))), end=' ')


n = int(input())
a = []
while n != 0:
	s = str(n)
	t = ''
	for i in range(len(s)):
		if s[i] != '0':
			t += '1'
		else:
			t += '0'
	a.append(t)
	n -= int(t)
print(len(a))
print(*a)


import sys
from collections import Counter
from math import factorial
input = sys.stdin
output = sys.stdout

def read_int():
	return [int(x) for x in input.readline().rstrip().split()]
[n] = read_int()
answer = list()
while n > 0:
	x = 0
	line = str(n)
	digits = list()
	for c in line:
		digits.append(c != '0')
	digits.reverse()
	for (i, d) in enumerate(digits):
		if d:
			x += 10 ** i
	answer.append(x)
	n -= x
output.write('%d\n' % len(answer))
first = True
for x in answer:
	if first:
		first = False
	else:
		output.write(' ')
	output.write(str(x))
output.write('\n')


def get_numbers(n):
	binary = []
	new_n = []
	for char in str(n):
		if int(char) != 0:
			binary.append('1')
			new_n.append(str(int(char) - 1))
		else:
			binary.append('0')
			new_n.append(char)
	if int(''.join(new_n)) == 0:
		return [''.join(binary)]
	else:
		return [''.join(binary)] + get_numbers(int(''.join(new_n)))
num = int(input())
fact = get_numbers(num)
print(len(fact))
print(' '.join(fact))


def qBinary(n):
	a = list(str(n))
	a = list(map(int, a))
	b = [0] * max(a)
	for i in range(len(a)):
		j = 0
		while a[i] > 0:
			b[j] += 10 ** (len(a) - i - 1)
			j += 1
			a[i] -= 1
	print(len(b))
	for i in b:
		print(i, end=' ')
n = int(input())
qBinary(n)


n = list(reversed(input()))
outs = [0] * 9
for i in range(len(n)):
	for x in range(int(n[i])):
		outs[x] += 10 ** i
outs = list([_f for _f in outs if _f])
print(len(outs))
print(*outs)


n = int(input())
digits = []
max_len = 0
while n:
	d = n % 10
	if d > max_len:
		max_len = d
	digits.append(d)
	n //= 10
answer = []
for (i, d) in enumerate(digits):
	row = [10 ** i] * d + [0] * (max_len - d)
	answer.append(row)
result = ''
for j in range(max_len):
	result += str(sum([row[j] for row in answer])) + ' '
print(max_len)
print(result)


def Count(n):
	if n == 0:
		return 0
	c = Count(n // 10)
	return n % 10 if n % 10 > c else c

def QNum(n):
	if n <= 0:
		return
	nn = n
	newN = 0
	string = ''
	p = 0
	out = 0
	while nn > 0:
		d = nn % 10
		nd = d - 1 if d > 0 else 0
		ndd = 1 if d > 0 else 0
		nn = nn // 10
		newN += nd * 10 ** p
		out += ndd * 10 ** p
		p += 1
	print(out)
	QNum(newN)
n = int(input())
print(Count(n))
QNum(n)


n = input()
m = max((int(x) for x in n))
ls = [''] * m
for x in n:
	y = int(x)
	for i in range(y):
		ls[i] += '1'
	for i in range(y, m):
		ls[i] += '0'
print(m)
for x in ls:
	print(int(x), end=' ')


s = input()
n = len(s)
a = []
for ch in s:
	a.append(int(ch))
ans = max(a)
print(ans)
for i in range(ans):
	num = 0
	for j in range(n):
		num *= 10
		if a[j] > 0:
			num += 1
			a[j] -= 1
	print(num, end=' ')


s = input()
n = len(s)
temp = [int(i) for i in s]
ans = ['' for i in range(9)]
for i in temp:
	for j in range(9):
		ans[j] += '01'[i > j]
ans = [i for i in map(int, ans) if i]
print(len(ans))
print(*ans)
quit()
from sys import stdin, stdout
read = lambda : map(int, stdin.readline().split())
I = lambda : stdin.readline()
n = int(I())
arr = tuple(read())
memo = {}
poss = [[0], [0, 1], [0, 2], [0, 1, 2]]
dp = [[10 ** 6 for i in range(3)] for i in range(n + 1)]
dp[n] = [0, 0, 0]
for i in range(n - 1, -1, -1):
	for last in range(3):
		for p in poss[arr[i]]:
			dp[i][last] = min(dp[i][last], (1 if last & p or p == 0 else 0) + dp[i + 1][p])
print(dp[0][0])


a = input()
j = 0
b = []
for i in a:
	if j < int(i):
		j = int(i)
print(j)
for i in range(j):
	b.append(0)
mult = 1
for i in a[::-1]:
	for k in range(int(i)):
		b[k] += mult
	mult *= 10
for i in range(j):
	print(b[i], end=' ')


n = int(input())
sol = []
while n > 0:
	N = n
	m = 0
	p = 1
	while N:
		if N % 10:
			m += p
		N //= 10
		p *= 10
	sol.append(m)
	n -= m
print(len(sol))
print(*sol)


n = int(input())
if 1 <= n < 9:
	print(n)
	for i in range(n):
		print(1, end=' ')
else:
	x = str(n)
	x = list(x)
	cnt = 0
	res = []
	while n > 0:
		tem = ''
		for i in range(len(x)):
			if x[i] != '1' and x[i] != '0':
				x[i] = '1'
				tem += x[i]
			else:
				tem += x[i]
		tem = int(tem)
		n = n - tem
		cnt = cnt + 1
		x = str(n)
		x = list(x)
		res.append(tem)
	res = reversed(res)
	print(cnt)
	print(*res, sep=' ')


n = int(input())
d_n = {}
t_n = n
m = 0
i = 0
while t_n > 0:
	i = max(1, i * 10)
	d_n[i] = t_n % 10
	t_n //= 10
	m = max(d_n[i], m)
print(m)
for _ in range(m):
	t_i = i
	o = 0
	while t_i > 0:
		o *= 10
		o += 1 if d_n[t_i] > 0 else 0
		d_n[t_i] -= 1
		t_i //= 10
	print(o, end=' ')


s = input()
n = int(s)
cont = []
while n > 0:
	res = ''
	for i in s:
		if i != '0':
			res += '1'
		else:
			res += '0'
	n -= int(res)
	cont.append(res)
	s = str(n)
print(len(cont))
for i in cont:
	print(i, end=' ')


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def get_binary_num(num):
	return int('{0:b}'.format(num))
hash_map = {}

def solve(n):
	if n == 0:
		return []
	if n < 10:
		return [1] * n
	if n in hash_map:
		return hash_map[n]
	l = len(str(n))
	_min = float('inf')
	res = []
	for i in range(int(2 ** l) - 1, int(2 ** (l - 1)) - 1, -1):
		binary_num = get_binary_num(i)
		if binary_num > n:
			continue
		r = [binary_num] + solve(n - binary_num)
		if len(r) < _min:
			res = r
			_min = len(r)
	hash_map[n] = res
	return res

def max_bin_n(num):
	num = str(num)
	res = ''
	for c in num:
		if c == '0':
			res += '0'
		else:
			res += '1'
	return int(res)

def solve_2(n):
	res = []
	while n:
		res.append(max_bin_n(n))
		n -= res[-1]
	return res
n = inp()
ans = solve_2(n)
print(len(ans))
print(' '.join(map(str, ans)))


n = int(input())
nums = [int(i) for i in str(n)]
output = []
for (index, i) in enumerate(nums):
	j = 0
	while j < i:
		try:
			output[j] += 1
		except:
			output.append(1)
		j += 1
	if index != len(nums) - 1:
		output = list(map(lambda x: x * 10, output))
print(len(output))
for i in output:
	print(i, end=' ')


n = int(input())
ls = []
while n:
	x = [c for c in str(n)]
	for i in range(len(x)):
		if x[i] > '1':
			x[i] = '1'
	low = int(''.join(x))
	n -= low
	ls.append(low)
print(len(ls))
print(*ls)


3

def main():
	s = list(map(int, input()))
	ans = [[1]]
	while ans[-1] != [0 for i in range(len(s))]:
		ans.append([0 for i in range(len(s))])
		for i in range(len(s)):
			if s[i] > 0:
				ans[-1][i] = 1
				s[i] -= 1
	print(len(ans) - 2)
	for i in range(1, len(ans) - 1):
		print(int(''.join(map(str, ans[i]))), end=' ')
	print()
main()


import math as mt
import sys, string, bisect
input = sys.stdin.readline
import random
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
d = defaultdict(int)
n = input().strip()
l = []
for i in n:
	l.append(int(i))
ans = []
while sum(l) != 0:
	i = 0
	s = 0
	while i < len(l):
		s *= 10
		if l[i] > 0:
			s += 1
			l[i] -= 1
		i += 1
	ans.append(s)
print(len(ans))
print(*ans)


x = []
for i in input():
	x += [int(i)]
l = []
while len(x):
	d = 0
	for i in range(len(x)):
		if x[i] > 0:
			d += int(10 ** (len(x) - i - 1))
			x[i] -= 1
	l += [d]
	while len(x) and x[0] == 0:
		x.pop(0)
print(len(l))
print(*l)


__author__ = 'ploskov'

def termination_condition(digit_list: 'list'):
	for digit in digit_list:
		if digit > 0:
			return False
	return True

def main():
	number = input()
	digit_list = [int(digit) for digit in number]
	answer = []
	while not termination_condition(digit_list):
		sub_number = [0 for digit in number]
		for index in range(len(digit_list)):
			if digit_list[index] > 0:
				sub_number[index] = 1
				digit_list[index] -= 1
		answer.append(str(int(''.join(map(str, sub_number)))))
	print(len(answer))
	print(' '.join(answer))
main()


n = int(input())
l = []
while n != 0:
	s = ''
	for i in list(str(n)):
		if i == '0':
			s += '0'
		else:
			s += '1'
	n -= int(s)
	l.append(int(s))
print(len(l))
print(*l)


import sys
input = sys.stdin.readline
inf = int(10000000000.0)
n = int(input())
ans = []
while n:
	a = n
	d = 0
	c = 0
	while a:
		r = a % 10
		if r != 0:
			d += 10 ** c
		c += 1
		a //= 10
	n -= d
	ans.append(d)
print(len(ans))
print(*ans)


__author__ = 'artyom'
(i, a, n) = (1000000, [], int(input()))
while i > 0:
	a.append(n // i)
	n %= i
	i //= 10
(p, l) = ([], len(a))
while 1:
	(y, z) = ('', 1)
	for i in range(l):
		if a[i] > 0:
			a[i] -= 1
			y += '1'
			z = 0
		elif not z:
			y += '0'
	if z:
		break
	else:
		p.append(y)
print(len(p))
print(' '.join(p))


s = input()
mat = []
for i in s:
	mat.append(int(i))
sat = [0] * max(mat)
for i in range(len(mat)):
	for j in range(mat[i]):
		sat[j] += 10 ** (len(mat) - i - 1)
print(len(sat))
print(*sat)


n = int(input())
ans = []
while n:
	b = ''.join((str(int(i != '0')) for i in str(n)))
	n -= int(b)
	ans.append(b)
print(len(ans))
print(*ans)


n = [int(i) for i in input()]
ans = []
while sum(n) > 0:
	s = ''
	for i in range(len(n)):
		if n[i] == 0:
			if len(s) != 0:
				s = s + '0'
		else:
			s = s + '1'
			n[i] -= 1
	ans.append(s)
print(len(ans))
print(' '.join(ans))


a = int(input())
ans = []
while a > 0:
	t = a
	now = 0
	x = 1
	while t > 0:
		if t % 10 > 0:
			now = now + x
		x = x * 10
		t = t // 10
	ans = ans + [now]
	a = a - now
print(len(ans))
for index in range(len(ans)):
	if index == len(ans) - 1:
		print(ans[index])
	else:
		print(ans[index], end=' ')


def main():
	s = list(map(int, input()))
	ans = []
	while max(s) != 0:
		t = []
		for i in range(len(s)):
			t.append('1' if s[i] else '0')
			s[i] = max(0, s[i] - 1)
		ans.append(t)
	print(len(ans))
	print(' '.join([''.join(_).lstrip('0') for _ in ans]))
main()


n = [int(i) for i in input()]
n_sorted = list(map(lambda x: list(x), list(enumerate(n.copy()))))
n_sorted.sort(key=lambda x: x[1])
estado = ['1' for i in range(len(n))]
numeros = []
for k in n_sorted:
	numeros += k[1] * [int(''.join(estado))]
	sub = k[1]
	for i in n_sorted:
		i[1] -= sub
	estado[k[0]] = '0'
print(len(numeros))
print(*numeros)


n = list(map(lambda x: int(x), list(input())))
maxval = max(n)
ans = [''] * maxval
ns = len(n)
for c in n:
	for i in range(maxval):
		if i < c:
			ans[i] += '1'
		else:
			ans[i] += '0'
ans = list(map(lambda x: str(int(x)), ans))
print(maxval)
print(' '.join(ans))


n = int(input())
arr = []
while n > 0:
	x = [int(i) for i in str(n)]
	q = [min(i, 1) for i in x]
	q = ''.join([str(i) for i in q])
	q = int(q)
	arr.append(q)
	n -= q
print(len(arr))
print(*arr)


def conv(ele):
	return int(''.join(ele))
n = input()
int_n = int(n)
ans = max([int(i) for i in n])
seq = []
for i in n:
	seq.append(['1' for i in range(int(i))] + ['0' for i in range(ans - int(i))])
ans_seq = [[i[j] for i in seq] for j in range(ans)]
ans_seq = list(map(conv, ans_seq))
print(ans)
print(*ans_seq)


n = int(input())
prev = []
while n:
	x = ''.join((str(int(i != '0')) for i in str(n)))
	prev.append(x)
	n -= int(x)
print(len(prev))
print(*prev)


n = int(input())
c = str(n)
L = [int(c[i]) for i in range(len(c))]
R = ''
r = 0
while max(L) > 0:
	r += 1
	s = ''
	for i in range(len(c)):
		if L[i] > 0:
			L[i] -= 1
			s = s + '1'
		else:
			s = s + '0'
	R = R + s[s.index('1'):] + ' '
print(r)
print(R)


num = input()
le = len(num)
num2 = [0] * le
for i in range(le):
	num2[i] = int(num[i])
print(max(num2))
for i in range(le):
	while num2[i] > 0:
		print(1, end='')
		for j in range(i + 1, le):
			if num2[j] > 0:
				num2[j] -= 1
				print(1, end='')
			else:
				print(0, end='')
		print(' ', end='')
		num2[i] -= 1


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from functools import cmp_to_key
from heapq import *
from math import gcd, factorial, floor, ceil, sqrt
from copy import deepcopy
from collections import deque
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def testcase(t):
	for pp in range(t):
		solve(pp)

def google(p):
	print('Case #' + str(p) + ': ', end='')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(x, y, p):
	y %= p - 1
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
inf = pow(10, 20)
mod = 10 ** 9 + 7

def con(n):
	a = ''
	for i in n:
		a += i
	return int(a)

def solve(case):
	n = inp()
	ans = []
	n = list(str(n))
	while con(n) > 0:
		curr = ['1']
		for i in range(1, len(n)):
			if n[i] == '0':
				curr += '0'
			else:
				curr += '1'
		ans.append(curr)
		n = list(str(con(n) - con(curr)))
	print(len(ans))
	for i in range(len(ans)):
		ans[i] = ''.join(ans[i])
	print(' '.join(ans))
testcase(1)


q = input()
count = 0
arr1 = []
q = int(q)
t = ''
while q > 0:
	for i in str(q):
		if i > '0':
			t += '1'
		else:
			t += '0'
	x = int(t)
	count += 1
	arr1.append(x)
	q = q - x
	t = ''
print(count)
print(*arr1)


def main():
	n = input()
	quasib = resuelve(n)
	print(len(quasib))
	print(*quasib)

def resuelve(cadena: str) -> [int]:
	lista = []
	if not cadena:
		return lista
	else:
		n = int(cadena)
		binario = 0
		while n > 0:
			binario = get_binario(n)
			lista.append(binario)
			n = n - binario
		return lista

def get_binario(entrada: int) -> int:
	entrada = str(entrada)
	cifras = len(entrada)
	num = 0
	for i in entrada:
		cifras = cifras - 1
		if i != '0':
			num = num + 10 ** cifras
	return num
main()


def solve(num):
	nums = list(map(int, [c for c in str(num)]))
	rv = []
	for v in list(range(9, 0, -1)):
		curval = 0
		for (idx, n) in enumerate(nums):
			if n >= v:
				curval += 10 ** (len(nums) - 1 - idx)
		if curval > 0:
			rv.append(str(curval))
	return (max(nums), ' '.join(rv))
import sys
data = sys.stdin.read().strip()
(count, ans) = solve(data)
print(count)
print(ans)


n = input()

def ans(n):
	li = []
	maxm = int(n[0])
	for i in n:
		li.append(int(i))
		maxm = max(maxm, int(i))
	print(maxm)
	l = len(li)
	deepshri = []
	for i in range(maxm):
		s = ''
		for j in range(l):
			if li[j] != 0:
				s += '1'
				li[j] -= 1
			else:
				s += '0'
		deepshri.append(s)
	for i in deepshri:
		print(int(i), end=' ')
ans(n)


n = int(input())
num = []
for i in str(n):
	num.append(int(i))
ans = []
while max(num) != 0:
	val = 0
	for i in range(len(num)):
		starting = 10 ** (len(num) - 1 - i)
		if num[i] > 0:
			val += starting
			num[i] -= 1
	ans.append(val)
print(len(ans))
print(*ans)


import sys
fin = sys.stdin
n = int(fin.readline())
r = []
while n > 0:
	p10 = 1
	cr = 0
	while p10 <= n:
		if n // p10 % 10 != 0:
			cr += p10
			n -= p10
		p10 *= 10
	r.append(cr)
print(len(r))
for x in r:
	print(x, end=' ')


a = list(map(int, list(input())))
r = []
while True:
	ok = False
	p = 0
	for i in range(len(a)):
		p = p * 10 + (a[i] > 0)
		if a[i]:
			ok = True
			a[i] -= 1
	if not ok:
		break
	else:
		r.append(p)
print(len(r))
print(*r)


n = int(input())
res = []
while n > 0:
	sn = str(n)
	tmp = ''
	for e in map(int, sn):
		tmp += '1' if e >= 1 else '0'
	n -= int(tmp)
	res.append(tmp)
print(len(res))
print(*res)


n = int(input())
b = [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, 1000011, 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]
b = b[::-1]

def FindNumber(n):
	m = 0
	while n != 0:
		if n % 10 > m:
			m = n % 10
		n = int(n / 10)
	return m
number = FindNumber(n)
print(number)

def FindNum(n, number):
	global b
	if number != FindNumber(n):
		return -1
	if number == 1:
		print(n, end=' ')
		return 1
	for i in b:
		if i > n:
			continue
		else:
			num = FindNum(n - i, number - 1)
			if num == -1:
				continue
			else:
				print(i, end=' ')
				break
FindNum(n, number)


def STR():
	return list(input())

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def MAP2():
	return map(float, input().split())

def LIST():
	return list(map(int, input().split()))

def STRING():
	return input()
from heapq import heappop, heappush
from bisect import *
from collections import deque, Counter
from math import *
from itertools import permutations
dx = [-1, 1, 0, 0]
dy = [0, 0, 1, -1]
n = INT()
res = []
while n > 0:
	z = ''
	for i in str(n):
		z += str(min(1, int(i)))
	n -= int(z)
	res.append(z)
print(len(res))
for i in res:
	print(i, end=' ')


a = list(map(int, list(input())))
m = max(a)
b = [0] * m
for i in a:
	for j in range(m):
		b[j] = b[j] * 10 + (1 if j < i else 0)
print(m)
print(*b)


def getVal(n):
	r = 0
	bas = 1
	while n > 0:
		if n % 10 > 0:
			r += bas
		bas *= 10
		n = int(n / 10)
	return r
res = []
n = int(input())
while n > 0:
	t = getVal(n)
	n -= t
	res.append(t)
print(len(res))
for x in res:
	print(x, '', end='')


n = int(input())
v = []
while n != 0:
	a = 1
	i = 0
	while n // a != 0:
		if n % (a * 10) // a != 0:
			i += a
			n -= a
		a *= 10
	v.append(i)
print(len(v))
print(' '.join(map(str, v)))


def main():
	n = input()
	prob = [int(digit) for digit in n][::-1]
	res = []
	for i in range(max(prob)):
		num = 0
		for (index, number) in enumerate(prob):
			if number >= i + 1:
				num += 10 ** index
		res.append(num)
	print(len(res))
	print(' '.join([str(number) for number in res]))
main()


__author__ = 'huash06'
import os
import sys
import functools
import collections
import itertools
import math

class Solution:

	def __init__(self):
		self.N = 0

	def readInput(self):
		self.N = input()

	def readMockInput(self):
		pass

	def solve(self):
		num = list(map(int, self.N))
		res = []
		while num.count(0) < len(num):
			tmp = ''
			for i in range(len(num)):
				if num[i] > 0:
					num[i] -= 1
					tmp += '1'
				elif len(tmp) > 0:
					tmp += '0'
			res.append(tmp)
		print(len(res))
		print(' '.join(res))
s = Solution()
s.readInput()
s.solve()


n = input()
ans1 = max([int(x) for x in n])
ans2 = ['' for _ in range(ans1)]
for i in n:
	cnt = int(i)
	for j in range(ans1):
		if cnt > 0:
			ans2[j] += '1'
			cnt -= 1
		else:
			ans2[j] += '0'
print(ans1)
print(' '.join([str(int(x)) for x in ans2]))


x = input()
lol = ''
c = 0
yo = []
while int(x) > 0:
	if int(x) < 10:
		c += int(x)
		yo = yo + [1] * int(x)
		x = 0
	else:
		for i in x:
			if int(i) >= 1:
				lol += '1'
			else:
				lol += '0'
		x = str(int(x) - int(lol))
		yo.append(lol)
		lol = ''
		c += 1
print(c)
print(*yo)


n = int(input())
ans = []
while n:
	t = n
	i = 1
	cur = 0
	while t:
		if t % 10:
			cur += i
		t = t // 10
		i *= 10
	ans.append(cur)
	n -= cur
print(len(ans))
print(' '.join(map(str, ans)))


n = int(input())
l = len(str(n)) - 1
k = int(str(n)[0:1])
a = [10 ** l] * k
n = n - k * a[0]
while n > 0:
	l = len(str(n)) - 1
	k = int(str(n)[0:1])
	b = 10 ** l
	if k > len(a):
		z = k - len(a)
		for i in range(z):
			a.append(b)
			n = n - b
		for i in range(len(a)):
			if n - b >= 0:
				a[i] = a[i] + b
				n = n - b
	else:
		for i in range(k):
			a[i] = a[i] + b
		n = n - k * b
print(len(a))
print(*a)


import os
import sys
from io import BytesIO, IOBase
from itertools import permutations

def main():
	n = int(input())
	temp = list(map(int, list(str(n))))
	print(max(temp))
	yoyo = max(temp)
	ans = [''] * max(temp)
	for x in range(len(temp)):
		cnt = 0
		while temp[x] != 0:
			ans[cnt] += '1'
			cnt += 1
			temp[x] -= 1
		while cnt < yoyo:
			ans[cnt] += '0'
			cnt += 1
	ans = list(map(int, ans))
	print(*ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = input()
answer = []
for j in range(int(n[0])):
	answer.append(10 ** (len(n) - 1))
for i in range(1, len(n)):
	j = 0
	while j < len(answer) and j < int(n[i]):
		answer[j] += 10 ** (len(n) - i - 1)
		j += 1
	if j < int(n[i]):
		while j < int(n[i]):
			answer.append(10 ** (len(n) - i - 1))
			j += 1
print(len(answer))
print(*answer)


n = int(input())
a = []
while n > 0:
	dig = n % 10
	a.append(dig)
	n = n // 10
a.reverse()
k = len(a)
b = []
for i in range(9):
	w = ''
	for j in range(k):
		if a[j] > 0:
			w += '1'
			a[j] -= 1
		else:
			w += '0'
	b.append(int(w))
c = []
for i in b:
	if i != 0:
		c.append(i)
print(len(c))
for i in c:
	print(i, end=' ')
print()


k = [int(i) for i in input()]
print(max(k))
nums = []
while max(k) > 0:
	d = ['0'] * len(k)
	for x in range(len(k)):
		if k[x] > 0:
			k[x] -= 1
			d[x] = '1'
	n = ''.join(d)
	while n[0] == '0':
		n = n[1:]
	nums.append(n)
print(' '.join(nums))


def solve():
	n = int(input())
	if n == 0:
		print(1)
		print(0)
		return
	a = [0] * 10
	k = n
	max = 0
	for i in range(0, 10):
		if k > 0:
			a[i] = k % 10
			if a[i] > max:
				max = a[i]
		k = int(k / 10)
	print(max)
	sum = 0
	for j in range(0, max):
		r = 0
		k = 1
		for i in range(0, 10):
			if a[i] > 0:
				a[i] = a[i] - 1
				r = r + k
			k = k * 10
		print(r, end=' ')
		sum = sum + r
solve()


n = int(input())
result = []
while True:
	temp = str(n)
	ans = ''
	for i in range(len(temp)):
		if int(temp[i]) < 2:
			if temp[i] == '0':
				ans += '0'
			else:
				ans += '1'
		else:
			ans += '1'
	result.append(int(ans))
	n -= int(ans)
	if n == 0:
		break
print(len(result))
for i in range(len(result)):
	print(result[i], end=' ')


n = input()
x = int(max(n))
print(x)
l = [*map(int, n)]
res = [[0] * len(l) for _ in range(max(l))]
for i in range(x):
	for j in range(len(l)):
		if l[j] > 0:
			l[j] -= 1
			res[i][j] += 1
res = [int(''.join(map(str, e))) for e in res]
print(*res, sep=' ')


l = list(map(int, list(input())))
print(max(l))
ans = []
while l.count(0) != len(l):
	k = ['0' for i in range(len(l))]
	for i in range(len(l)):
		if l[i] != 0:
			l[i] -= 1
			k[i] = '1'
	ans.append(str(int(''.join(k))))
print(' '.join(ans))


s = list(map(int, list(input().strip())))
print(max(s))
while s:
	if s[0] == 0:
		s = s[1:]
		continue
	for i in range(len(s)):
		if s[i] != 0:
			print(1, end='')
			s[i] -= 1
		else:
			print(0, end='')
	print(end=' ')


n = int(input())
res = []
while n != 0:
	s = str(n)
	x = str()
	for c in s:
		if c == '0':
			x += '0'
		else:
			x += '1'
	res.append(int(x))
	n -= int(x)
print(len(res))
print(' '.join(map(str, res)))


n = int(input())
ls = []
total = 0
while n > 1:
	tmp = ''
	count = 0
	n = str(n)
	for i in range(len(n)):
		if n[i] == '0':
			tmp += '0'
			count += 1
		else:
			tmp += '1'
		if n[i] == '1':
			count += 1
	temp = int(tmp)
	ls.append(temp)
	n = int(n)
	n -= temp
	total += 1
if n == 1:
	ls.append(1)
	total += 1
print(total)
for num in ls:
	print(num, end=' ')


def main():
	N = int(input())
	a = []
	while N:
		num = N
		counter = 0
		count = 1
		while num:
			if num % 10:
				counter += count
			num //= 10
			count *= 10
		a.append(counter)
		N -= counter
	print(len(a))
	a.sort()
	for item in a:
		print(int(item), end=' ')
main()


def check_quasi_binary(number):
	number_str = str(number)
	result = True
	for char in number_str:
		if not (char == '0' or char == '1'):
			result = False
			break
	return result

def find_max_quasi_binary(number):
	number_str = str(number)
	result = ''
	for char in number_str:
		if char != '0':
			result += '1'
		else:
			result += '0'
	return int(result)
n = int(input())
quasi_binary_sum = []
while n > 0:
	max_quasi_binary = find_max_quasi_binary(n)
	quasi_binary_sum.append(max_quasi_binary)
	n -= max_quasi_binary
print(len(quasi_binary_sum))
print(' '.join([str(x) for x in sorted(quasi_binary_sum)]))


n = int(input())
steps = 0
s = ''
while True:
	if n == 0:
		break
	elif n == 1:
		s += str(n)
		steps += 1
		break
	else:
		n_str = str(n)
		n_str_upd = ''
		for i in range(len(n_str)):
			if ord(n_str[i]) > ord('0'):
				n_str_upd += str(int(n_str[i]) - 1)
			else:
				n_str_upd += str(int(n_str[i]))
		steps += 1
		n_upd = int(n_str_upd)
		s += str(n - n_upd) + ' '
		n = n_upd
print(steps)
print(s)


n = input()
k = []
s = ''
a = [int(i) for i in n]
for i in range(max(a)):
	for j in range(len(a)):
		if a[j] > 0:
			s += '1'
		else:
			s += '0'
		a[j] -= 1
	k.append(int(s))
	s = ''
print(len(k))
for i in range(len(k)):
	print(k[i], end=' ')


s = input()
print(int(max(s)))
for i in range(int(max(s))):
	res = ''
	for c in s:
		if i + 1 <= int(c):
			res += '1'
		else:
			res += '0'
	print(int(res), end=' ')
print()


x = str(int(input()))
(li, li2, y) = ([], [], int(max(x)))
for i in x:
	li.append(int(i))
for i in range(y):
	str1 = ''
	for j in range(len(x)):
		if li[j] > 0:
			str1 += str(1)
			li[j] -= 1
		else:
			str1 += str(0)
	li2.append(int(str1))
print(y)
print(*li2)


n = int(input())
a = [0] * 10
k = 1
while n > 0:
	m = n % 10
	for i in range(m):
		a[i] += k
	k *= 10
	n = int(n / 10)
i = 0
k = 0
while a[i] != 0:
	i += 1
	k += 1
print(k)
for x in a:
	if x != 0:
		print(x, end=' ')


a = input()
list = []
m = ''
s = int(a)
while s > 0:
	for i in range(len(a)):
		if int(a[i]) > 0:
			m += '1'
		else:
			m += '0'
	list.append(m)
	s = s - int(m)
	a = str(s)
	m = ''
print(len(list))
for i in range(len(list)):
	print(list[i], end=' ')


import math
a = input()
d = int(max(a))
print(d)
dec = math.ceil(math.log10(int(a)))
c = [0] * d
if int(a) != 10 ** dec:
	for i in a:
		for j in range(int(i)):
			c[j] = c[j] + 10 ** (dec - 1)
		dec = dec - 1
d = ''
for i in c:
	d += str(i) + ' '
if int(a) == 10 ** dec:
	print(a)
else:
	print(d.strip())


__author__ = 'Данила'
n = input()
a = []
s = int(n)
min = 0
for i in range(len(n)):
	if int(n[i]) > min:
		min = int(n[i])
print(min)
while s != 0:
	s1 = str(s)
	k = ''
	for i in range(len(s1)):
		if s1[i] != '0':
			k += '1'
		else:
			k += '0'
	print(k, end=' ')
	s -= int(k)


n = int(input())
lst = list()
while n > 0:
	t = ''
	for elem in str(n):
		t += str(min(int(elem), 1))
	n -= int(t)
	lst.append(t)
print(len(lst))
print(*lst)


n = list(map(int, input()))
ans = []
while True:
	num = ''
	for i in range(len(n)):
		if n[i] > 0:
			num += '1'
			n[i] -= 1
		else:
			num += '0'
	num = int(num)
	if num == 0:
		break
	else:
		ans.append(num)
print(len(ans))
print(' '.join(map(str, ans)))


n = int(input())
d = {}
x = 0
maximum = -1
list1 = []
while n > 0:
	d[str(10 ** x)] = n % 10
	if maximum < n % 10:
		maximum = n % 10
	n = n // 10
	x += 1
print(maximum)
for z in range(maximum):
	sum1 = 0
	for y in d:
		if int(d[y]) > 0:
			sum1 += int(y)
			d[y] -= 1
	print(sum1, end=' ')


n = input()
l = []
for i in range(9):
	s = ''
	for j in n:
		if ord(j) - i - 48 > 0:
			s += '1'
		else:
			s += '0'
	l.append(s)
for i in range(9):
	l[i] = int(l[i])
while True:
	try:
		l.remove(0)
	except:
		break
print(len(l))
print(*l)


store = []

def func(s):
	l = len(str(s))
	f = ['0'] * l
	f[0] = '1'
	for i in range(1, l):
		f[i] = '1'
		if int(str(s)[i]) < int(f[i]):
			f[i] = '0'
	store.append(''.join(f))
	s -= int(''.join(f))
	return s
n = int(input())
while n:
	n = func(n)
store.reverse()
print(len(store))
for i in store:
	print(i, end=' ')


import sys
input = sys.stdin.readline
(inp, ip) = (lambda : int(input()), lambda : [int(w) for w in input().split()])
s = input().strip()
mx = max(map(int, s))
print(mx)
n = len(s)
x = [['0'] * n for i in range(mx)]
for i in range(n):
	for j in range(int(s[i])):
		x[j][i] = '1'
x = [int(''.join(i)) for i in x]
print(*x)


def get_ner(n):
	k = 0
	while True:
		res = int(str(bin(k + 1))[2:])
		if res > n:
			break
		k += 1
	return int(str(bin(k))[2:])
n = int(input())
ans = []
while n != 0:
	k = n
	m = 0
	p = 1
	while k != 0:
		if k % 10 != 0:
			m += p
		k //= 10
		p *= 10
	ans.append(m)
	n -= m
print(len(ans))
print(*ans)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	a = [int(c) for c in S()]
	l = len(a)
	t = max(a)
	r = []
	for i in range(t):
		u = []
		for j in range(l):
			if a[j] > 0:
				u.append(1)
				a[j] -= 1
			else:
				u.append(0)
		r.append(int(''.join(map(str, u))))
	return '{}\n{}'.format(t, ' '.join(map(str, r)))
print(main())


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = 0
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = 1
			break
	return ans

def sieve_of_eratosthenes(n):
	ans = []
	arr = [1] * (n + 1)
	(arr[0], arr[1], i) = (0, 0, 2)
	while i * i <= n:
		if arr[i] == 1:
			j = i + i
			while j <= n:
				arr[j] = 0
				j += i
		i += 1
	for k in range(n):
		if arr[k] == 1:
			ans.append(k)
	return ans

def nc2(x):
	if x == 1:
		return 0
	else:
		return x * (x - 1) // 2

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far
from math import *
for _ in range(1):
	li = list(input())
	li = [int(x) for x in li]
	print(max(li))
	while any(li):
		ans = ''
		for i in range(len(li)):
			if li[i] != 0:
				ans += '1'
				li[i] -= 1
			else:
				ans += '0'
		print(ans.lstrip('0'), end=' ')
	print('')


def solved(s):
	r = ''
	for i in range(len(s)):
		if s[i] != '0':
			s[i] = str(int(s[i]) - 1)
			r += '1'
		else:
			r += '0'
	return (r, s)
n = list(input())
a = list()
while len(n):
	(r, n) = solved(n)
	a.append(r)
	while len(n):
		if n[0] == '0':
			n.pop(0)
		else:
			break
print(len(a))
for i in a:
	print(i, end=' ')


from math import log10, floor, ceil
n = int(input())

def get_list(x):
	l = []
	k = floor(log10(x)) + 1
	for i in range(k):
		a = x % 10
		x = (x - a) // 10
		l.append(a)
	return l
l = get_list(n)
k = max(l)
print(k)
while sum(l) > 0:
	m = 0
	for i in range(len(l)):
		if l[i] > 0:
			l[i] -= 1
			m += 10 ** i
	print(m, end=' ')


a = input()
inputList = [int(x) for x in reversed(a)]
outputList = []
listItem = 0
while sum(inputList) != 0:
	listItem = 0
	for i in range(0, len(inputList)):
		if inputList[i] != 0:
			listItem += 10 ** i
			inputList[i] -= 1
	outputList.append(listItem)
print(len(outputList))
for i in reversed(outputList):
	print(i, end=' ')


n = input()
B = [0 for i in range(7)]
while len(n) != 7:
	n = '0' + n
ans = 0
for i in range(7):
	ans = max(ans, int(n[i]))
	B[i] = int(n[i])
print(ans)
s = ''
for i in range(ans):
	cur = [0 for i in range(7)]
	for j in range(7):
		if B[j] > 0:
			cur[j] = 1
			B[j] -= 1
	was = False
	for j in range(7):
		if cur[j] == 1:
			s += '1'
			was = True
		elif was:
			s += '0'
	s += ' '
print(s[:-1])


a = int(input())
print(max(str(a)))
b = [''] * int(max(str(a)))
for i in range(len(str(a)) - 1, -1, -1):
	for j in range(len(b)):
		b[j] += '0'
	for j in range(int(str(a)[i])):
		b[j] = b[j][:-1]
		b[j] += '1'
for i in range(len(b)):
	b[i] = str(int(b[i][::-1]))
print(' '.join(b))


n = input()
ans = max((int(c) for c in n))
print(ans)
vl = len(n)
n = int(n)
for i in range(ans):
	x = 0
	for j in range(vl):
		dig = n % 10 ** (j + 1) // 10 ** j
		if dig != 0:
			n -= 10 ** j
			x += 10 ** j
	print(x, end=' ')


L = list(input())
L = list(map(int, L))
N = len(L)
ans = 0
ansl = []
while True:
	ret = ''
	for i in range(N):
		if L[i] != 0:
			ret += '1'
			L[i] -= 1
		else:
			ret += '0'
	ret = int(ret)
	if ret == 0:
		break
	ans += 1
	ansl.append(ret)
print(ans)
print(' '.join(map(str, ansl)))


x = input()
s = int(max(x))
print(s)
ls = list(map(int, x))
v = []

def f(s):
	res = 0
	s.reverse()
	for n in range(len(s)):
		res += s[n] * 10 ** n
	return res
res = []
for n in range(s):
	j = []
	for n in range(len(ls)):
		if ls[n] > 0:
			j.append(1)
			ls[n] -= 1
		else:
			j.append(0)
	v.append(j)
res = list(map(f, v))
print(*res)


def psuedoBinary(n, l):
	while n > 0:
		temp = n
		m = 0
		p = 1
		while temp:
			rem = temp % 10
			temp = int(temp / 10)
			if rem != 0:
				m += p
			p *= 10
		l.append(m)
		n = n - m
n = int(input())
l = []
psuedoBinary(n, l)
print(len(l))
print(*l[::-1])


given = int(input())
answer = []
while given != 0:
	current = ''
	for i in str(given):
		current += str(min(int(i), 1))
	given -= int(current)
	answer.append(current)
print(len(answer))
print(*answer)


import math, sys, bisect, heapq
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
int1 = lambda x: int(x) - 1
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))
ilelec = lambda : map(int1, input().split())
alelec = lambda : list(map(int1, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]
MOD = 1000000000 + 7

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])
A = []
old = input()
while int(old):
	new = ''
	v = ''
	for i in old:
		if i == '0':
			new += i
			v += i
		else:
			new += str(int(i) - 1)
			v += '1'
	old = new
	A.append(int(v))
print(len(A))
print(*A)


n = int(input())
res = []
digit = dict.fromkeys(map(ord, '123456789'), '1')
while n:
	val = str(n).translate(digit)
	n -= int(val)
	res.append(val)
print(len(res))
print(*res)


def main():
	number = int(input())
	quasi_list = [0 for _ in range(9)]
	digitpos = 0
	n = number
	while n > 0:
		digit = n % 10
		n = n // 10
		for i in range(digit):
			quasi_list[i] += 10 ** digitpos
		digitpos += 1
	while quasi_list[-1] == 0:
		quasi_list.pop()
	print(len(quasi_list))
	quasi2str = list(map(str, quasi_list))
	print(' '.join(quasi2str))
main()


n = int(input())
l = []
while n > 0:
	l.append(n % 10)
	n = n // 10
print(max(l))
m = max(l)
for i in range(m):
	ma = max(l)
	a = 0
	mu = 1
	for j in range(len(l)):
		if l[j] == ma:
			l[j] -= 1
			a += mu
		mu *= 10
	print(a, end=' ')
print()


s = input()
lst = []
for i in s:
	lst.append(int(i))
lst2 = [''] * max(lst)
n = max(lst)
m = len(lst)
lst = lst[::-1]
for i in lst:
	for j in range(i):
		lst2[j] = '1' + lst2[j]
	for j in range(i, n):
		lst2[j] = '0' + lst2[j]
for i in range(n):
	curr = lst2[i]
	index = 0
	for j in range(m):
		if curr[j] == '1':
			index = j
			break
	lst2[i] = curr[index:]
print(n)
print(' '.join(lst2))


n = int(input())
tem = n
arr = []
while tem > 0:
	x = tem
	z = 0
	l = 0
	while x > 0:
		y = x % 10
		if y > 0:
			z = (z + 1) / 10
		else:
			z = z / 10
		l += 1
		x = x // 10
	z = int(z * 10 ** l)
	tem += -z
	arr.append(z)
print(len(arr))
for i in arr:
	print(i, end=' ')


ans = []

def reduce(x):
	ans = ''
	for i in x:
		if int(i) > 1:
			ans += '1'
		else:
			ans += i
	return int(ans)

def res(x):
	global ans
	m = reduce(str(x))
	ans.append(m)
	if m == x:
		return 1
	else:
		x = x - m
		return 1 + res(x)
n = int(input())
print(res(n))
for i in ans:
	print(i, end=' ')


def solve1(n):
	r = []
	while n > 0:
		t = int(''.join(['0' if x == '0' else '1' for x in str(n)]))
		n -= int(t)
		r.append(t)
	print(len(r))
	print(' '.join(map(str, r)))
num = int(input())
solve1(num)


import os
import sys
debug = True
if debug and os.path.exists('input.in'):
	input = open('input.in', 'r').readline
else:
	debug = False
	input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
test_count = 1
if debug:
	test_count = int(input())
for t in range(test_count):
	if debug:
		print('Test Case #', t + 1)
	n = inp()
	digits = str(n)
	max_digits = int(max(list(digits)))
	num = ['0'] * len(digits)
	nums = list()
	for _ in range(max_digits):
		nums.append(num.copy())
	for i in range(len(digits)):
		x = int(digits[i])
		for j in range(x):
			nums[j][i] = '1'
	print(max_digits)
	for x in nums:
		print(''.join(x).lstrip('0'), end=' ')
	print('\n')


n = list(map(int, input()))
abc = []
while n.count(0) < len(n):
	ans = ''
	for i in range(len(n)):
		if n[i] != 0:
			ans += '1'
			n[i] -= 1
		else:
			ans += '0'
	abc.append(ans)
print(len(abc))
for j in range(len(abc)):
	if abc[j][0] == '0':
		for k in range(len(abc[j])):
			if abc[j][k] != '0':
				abc[j] = abc[j][k:]
				break
print(*abc)


n = int(input())
numbers = []
while n != 0:
	digits = list(str(n))
	next_number = int(''.join(list(('1' if digit != '0' else '0' for digit in digits))))
	numbers.append(next_number)
	n -= next_number
print(len(numbers))
print(' '.join((str(number) for number in numbers)))


def quasiBinary(n):
	ans = list()
	while n:
		tmp = str()
		for i in str(n):
			if int(i) >= 1:
				tmp += '1'
			else:
				tmp += '0'
		ans.append(tmp)
		n -= int(tmp)
	print(len(ans))
	for i in ans:
		print(i, end=' ')
n = int(input())
quasiBinary(n)


n = int(input())
qb = [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]
k = [[float('inf'), 0] for _ in range(n + 1)]
k[0][0] = 0
k[0][1] = 0
for i in range(1, n + 1):
	for j in qb:
		if i - j < 0:
			break
		if k[i][0] > k[i - j][0] + 1:
			k[i][0] = k[i - j][0] + 1
			k[i][1] = j
print(k[n][0])
i = n
j = k[n][1]
while i != 0:
	print(j, end=' ')
	i = i - j
	j = k[i][1]
print('')


x = int(input())
ans = []
while x >= 10:
	curr = ''
	for i in range(len(str(x))):
		if int(str(x)[i]) > 0:
			curr += '1'
		else:
			curr += '0'
	ans.append(curr)
	x -= int(curr)
while x:
	ans.append(1)
	x -= 1
print(len(ans))
for i in ans:
	print(i, end=' ')


n = list(map(int, input()))
result = []
while any(n):
	cn = ''
	for i in range(len(n)):
		cn += '1' if n[i] else '0'
		n[i] = max(0, n[i] - 1)
	result.append(str.lstrip(cn, '0'))
print(len(result))
print(str.join(' ', result))


n = int(input())
ans = []
while n > 0:
	buf = ''
	for i in str(n):
		if i != '0':
			buf += '1'
		else:
			buf += '0'
	ans.append(buf)
	n -= int(buf)
print(len(ans))
print(' '.join(map(str, ans)))


def main():
	num = [int(x) for x in list(input())]
	quasi_binary = []
	s = ''
	for i in range(max(num)):
		for j in range(len(num)):
			if num[j] > 0:
				s += '1'
				num[j] -= 1
			else:
				s += '0'
		quasi_binary.append(str(int(s)))
		s = ''
	print(len(quasi_binary))
	print(' '.join(quasi_binary))
main()


p = [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]
n = input()
f = 0
for j in range(len(p)):
	if p[j] <= int(n):
		f = j
u = []
x = 0
for j in range(len(n) - 1, -1, -1):
	a = int(n[j])
	if x == 0:
		if a == 0:
			u = ['0']
		else:
			u = ['1'] * a
		x += 1
	else:
		g = len(u) - 1
		for i in range(a):
			if g >= 0:
				u[g] = '1' + u[g]
				g -= 1
			else:
				u.insert(0, '1' + '0' * (len(u[0]) - 1))
		if g >= 0:
			for r in range(g, -1, -1):
				u[r] = '0' + u[r]
print(len(u))
for j in range(len(u)):
	u[j] = int(u[j])
print(*u)


n = int(input())
l = []
ans = []
cur = n
while cur > 0:
	l.insert(0, cur % 10)
	cur = cur // 10
f = 0
f1 = 0
while f1 == 0:
	s = ''
	for i in range(0, len(l)):
		if l[i] != 0:
			l[i] -= 1
			s += '1'
			f = 1
		elif l[i] == 0 and f == 1:
			s += '0'
	ans.append(int(s))
	if l.count(0) == len(l):
		f1 = 1
print(len(ans))
for ele in ans:
	print(ele, end=' ')


def quasibA(numberArray, resultArray):
	summand = []
	nichtN = False
	i = 0
	while i < len(numberArray):
		x = numberArray[i]
		if x > 0:
			summand.append(1)
			numberArray[i] = x - 1
			nichtN = True
		else:
			summand.append(0)
		i += 1
	summandAsInt = int(''.join(map(str, summand)))
	if nichtN:
		resultArray.append(summandAsInt)
		quasibA(numberArray, resultArray)
	else:
		print(str(len(resultArray)))
		print(' '.join(list(map(str, resultArray))))
number = input()
numberArray = [int(x) for x in number]
quasibA(numberArray, [])


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
a = []
for i in range(1, 65):
	a.append(int(bin(i).replace('0b', '')))
n = int(input())
ans = [999999999999999] * (n + 1)
ans[0] = 0
ans[1] = 1
for i in range(2, n + 1):
	for j in a:
		if i - j >= 0:
			ans[i] = min(ans[i], ans[i - j] + 1)
print(ans[n])
u = [0] * ans[n]
t = 0
s = set(a)
r = n
for i in range(n - 1, -1, -1):
	if ans[r] - ans[i] == 1 and r - i in s:
		u[t] = r - i
		t += 1
		r = i
print(*u, sep=' ')


n = int(input())
c = 0
l = []
while n > 0:
	c = c + 1
	temp = n
	m = 0
	p = 1
	while temp:
		rem = temp % 10
		temp = int(temp / 10)
		if rem != 0:
			m += p
		p *= 10
	l.append(m)
	n = n - m
print(c)
print(*l)


import sys
import math
input = sys.stdin.readline

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()

def lower_letters():
	lowercase = [chr(i) for i in range(97, 97 + 26)]
	return lowercase

def upper_letters():
	uppercase = [chr(i) for i in range(65, 65 + 26)]
	return uppercase
n = input().strip()
ans = []
while int(n) > 0:
	x = '1'
	for i in range(1, len(n)):
		if int(n[i]) > 0:
			x += '1'
		else:
			x += '0'
	ans.append(x)
	n = str(int(n) - int(x))
print(len(ans))
print(*ans)


n = int(input())
inf = 10 ** 9 + 9
ans = []
while n > 0:
	j = n
	b = 0
	t = 1
	while j > 0:
		b += t * int(j % 10 != 0)
		t *= 10
		j //= 10
	ans.append(b)
	n -= b
print(len(ans))
for i in ans:
	print(i, end=' ')


n = int(input())
a = [0 for i in range(0, 100)]
m = 0
t = 1
while n > 0:
	b = int(n % 10)
	m = max(m, b)
	for i in range(0, b):
		a[i] = a[i] + t
	t = t * 10
	n = n / 10
print(m)
for i in range(0, m):
	print(a[i], end=' ')


def fin(n):
	lis = list(str(n))
	ll = len(lis)
	no = [0] * ll
	for i in range(ll):
		if lis[i] >= '1':
			no[i] = '1'
		else:
			no[i] = '0'
	kk = int(''.join(no))
	return kk
n = int(input())
c = 0
ans = []
while n > 0:
	aa = fin(n)
	ans.append(aa)
	n -= aa
	c += 1
print(c)
print(*ans)


def main(k):
	num = list(map(int, k))
	res = []
	while True:
		st = []
		flag = False
		for i in range(len(num)):
			if num[i] > 0:
				st.append('1')
				num[i] -= 1
				flag = True
			else:
				st.append('0')
		if not flag:
			break
		res.append(str(int(''.join(st))))
	print(str(len(res)))
	print(' '.join(res))

def __starting_point():
	s = input()
	main(s)
__starting_point()


inp = input()
L = []
while int(inp) > 0:
	toa = ''
	for i in inp:
		if i != '0':
			toa += '1'
		else:
			toa += '0'
	inp = str(int(inp) - int(toa))
	L.append(int(toa))
print(len(L))
for i in L:
	print(i, end=' ')


n = int(input())
L = []
while n > 0:
	cb = ''.join([['0', '1'][int(k) > 0] for k in str(n)])
	L.append(cb)
	n -= int(cb)
print(len(L))
print(' '.join(L))


c = [int(x) for x in list(input())]
print(max(c))
for _ in range(max(c)):
	d = []
	for i in range(len(c)):
		if c[i] > 0:
			d.append('1')
			c[i] -= 1
		else:
			d.append('0')
	print(int(''.join(d)), end=' ')
print('')


n = input()
k = 0
a = []
while int(n) > 0:
	s = ''
	for x in n:
		if x == '0':
			s += '0'
		else:
			s += '1'
	n = str(int(n) - int(s))
	a.append(s)
	k += 1
print(k)
print(' '.join(a))


R = lambda : map(int, input().split())
x = int(input())
xs = list(map(int, str(x)))
res = []
while max(xs):
	k = min(filter(lambda i: i > 0, xs))
	raw = [1 if i >= k else 0 for i in xs]
	num = 0
	for xx in raw:
		num = 10 * num + xx
	res += [num] * k
	xs = [a - b for (a, b) in zip(xs, [i * k for i in raw])]
print(len(res))
print(' '.join(map(str, res)))


n = input().strip()
m = max([int(i) for i in n])
print(m)
for i in range(m):
	print(int(''.join(['1' if int(j) > i else '0' for j in n])), end=' ')


n = input()
m = 0
for i in n:
	if int(i) > m:
		m = int(i)
l = len(n)
t = [['0'] * l for i in range(m)]
for i in range(l):
	for j in range(int(n[i])):
		t[j][i] = '1'
print(m)
for i in range(m - 1):
	s = ''
	for j in t[i]:
		s += j
	print(int(s), end=' ')
s = ''
for j in t[m - 1]:
	s += j
print(int(s))


a = input()
n = [q for q in a]
s = []
t = ['0'] * len(n)
while n != t:
	d = ''
	for i in range(len(n)):
		if n[i] == '0':
			d += '0'
		else:
			d += '1'
			n[i] = str(int(n[i]) - 1)
	s.append(int(d))
print(len(s))
print(' '.join(map(str, s)))


n = list(map(int, input()))
le = len(n)
l = [['0'] * le for i in range(max(n))]
for j in range(le):
	for i in range(n[j]):
		l[i][j] = '1'
print(max(n))
l = list(map(''.join, l))
l = list(map(int, l))
print(' '.join(map(str, l)))


n = int(input())
m = 0
c = 1
i = n
while i > 0:
	m = max(m, i % 10)
	i = i // 10
a = [0] * m
i = n
while i > 0:
	for j in range(i % 10):
		a[j] += c
	c = c * 10
	i = i // 10
print(m)
for i in range(m):
	print(a[i], end=' ')


n = list(map(int, input()))
ans = []
k = len(n)
while sum(n) != 0:
	now = ''
	for i in range(k):
		if n[i] != 0:
			now += '1'
			n[i] -= 1
		else:
			now += '0'
	ans.append(int(now))
print(len(ans))
print(*ans)


n = input()
ans = int(max(list(n)))
print(ans)
for i in range(ans):
	num = ''
	for pos in range(len(n)):
		if int(n[pos]) >= i + 1:
			num += '1'
		else:
			num += '0'
	print(int(num), end=' ')


x = input()
k = [['0'] * len(x) for _ in range(10)]
ct = 0
maxx = 0
for i in x:
	for j in range(int(i)):
		k[j][ct] = '1'
	ct += 1
	maxx = max(maxx, int(i))
print(maxx)
for i in range(maxx):
	print(int(''.join(k[i])), end=' ')


from collections import defaultdict

def main():
	n = int(input())
	ans_list = []
	while n > 0:
		l = list(map(int, str(n)))
		d = [0] * len(l)
		for i in range(len(l)):
			d[i] = 1 if l[i] >= 1 else 0
			l[i] -= d[i]
		n = int(''.join(map(str, l)))
		ans_list.append(int(''.join(map(str, d))))
	print(len(ans_list))
	print(*ans_list, sep=' ')
main()


n = int(input())
s = ''
ans = 0
while n:
	ans += 1
	n1 = n
	mul = 1
	num = 0
	while n1:
		if n1 % 10:
			num += mul
		n1 //= 10
		mul *= 10
	n -= num
	s += str(num) + ' '
print(str(ans) + '\n' + s)


from sys import stdin, stdout
cin = stdin.readline
cout = stdout.write

def num(n):
	s = str(n)
	t = ''
	for ch in s:
		if ch == '0':
			t += '0'
		else:
			t += '1'
	return int(t)
n = int(cin())
ans = []
while n:
	k = num(n)
	n -= k
	ans.append(k)
cout(str(len(ans)) + '\n')
for bin in ans:
	cout(str(bin) + ' ')


n = input()
z = float('-inf')
l = [0 for i in range(len(n))]
for i in range(len(n)):
	l[i] = int(n[i])
k = max(l)
r = [[0 for i in range(len(n))] for j in range(k)]
for i in range(len(n)):
	for j in range(int(n[i])):
		r[j][i] = r[j][i] + 1
str_ = ''
for i in range(len(r)):
	s = ''
	flag = 0
	for j in range(len(r[i])):
		if r[i][j] == 0 and flag == 0:
			continue
		if r[i][j] == 1:
			flag = 1
		s = s + str(r[i][j])
	str_ = str_ + s + ' '
print(k)
print(str_)


n = str(int(input()))
l = []
while 1:
	s1 = ''
	k = 0
	for i in range(len(n)):
		if int(n[i]) > 1:
			s1 += '1'
			k = 1
		else:
			s1 += n[i]
	l.append(int(s1))
	if k == 0:
		break
	n = str(int(n) - int(s1))
print(len(l))
print(*l)


n = list(input())
digits = []
numbers = []
for i in range(len(n)):
	digits.append(int(n[i]))
for i in range(max(digits)):
	numbers.append(0)
for i in range(len(n)):
	for j in range(digits[i]):
		numbers[j] += 10 ** (len(n) - 1 - i)
print(max(digits))
for num in numbers:
	print(num, end=' ')


def res(arr):
	s = ''
	for item in arr:
		s += item
	return int(s)
s = input()
n = len(s)
m = max((int(c) for c in s))
x = [['0' for j in range(n)] for i in range(m)]
for j in range(n):
	for i in range(int(s[j])):
		x[i][j] = '1'
print(m)
for item in x:
	print(res(item), end=' ')


digits = list(map(int, list(input())))
quasis = list()
for x in range(max(digits)):
	nextQuasi = ''
	for y in range(len(digits)):
		if digits[y] > 0:
			nextQuasi += '1'
			digits[y] -= 1
		else:
			nextQuasi += '0'
	quasis.append(int(nextQuasi))
print(len(quasis))
print(' '.join(map(str, quasis)))


def solve(s):
	a = list(map(int, s))
	out = str(max(a)) + '\n'
	for i in range(max(a)):
		ts = ''
		for x in a:
			if x > i:
				ts += '1'
			else:
				ts += '0'
		out += ts.lstrip('0') + ' '
	return out
s = input()
print(solve(s))


n = input()
l = len(n)
m = int(max(n))
matrix = []
for i in range(m):
	matrix.append([0] * l)
for j in range(l):
	for k in range(int(n[j])):
		matrix[k][j] = 1
for i in range(m):
	while matrix[i][0] == 0:
		matrix[i].pop(0)
	matrix[i] = ''.join(map(str, matrix[i]))
print(len(matrix))
print(' '.join(map(str, matrix)))


from sys import stdin
n = int(stdin.readline().rstrip())
a = str(n)
l = []
while n > 0:
	x = 1
	for i in a[1:]:
		if int(i) > 0:
			x = x * 10 + 1
		else:
			x = x * 10
	l.append(x)
	n = n - x
	a = str(n)
print(len(l))
print(*l)


import time, math as mt, bisect, sys
from sys import stdin, stdout
from collections import defaultdict
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict
pi = 3.141592653589793

def II():
	return int(stdin.readline())

def IO():
	return stdin.readline()

def IP():
	return map(int, stdin.readline().split())

def L():
	return list(map(int, stdin.readline().split()))

def P(x):
	return stdout.write(str(x) + '\n')

def PI(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

def lcm(a, b):
	return a * b // gcd(a, b)

def gcd(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	if a > b:
		return gcd(a % b, b)
	else:
		return gcd(a, b % a)

def readTree():
	v = int(input())
	adj = [set() for i in range(v + 1)]
	for i in range(v - 1):
		(u1, u2) = In()
		adj[u1].add(u2)
		adj[u2].add(u1)
	return (adj, v)

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def sieve():
	li = [True] * 1000001
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	prime = []
	for i in range(1000001):
		if li[i] == True:
			prime.append(i)
	return prime

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count
mx = 10 ** 7
spf = [mx] * (mx + 1)

def SPF():
	spf[1] = 1
	for i in range(2, mx + 1):
		if spf[i] == mx:
			spf[i] = i
			for j in range(i * i, mx + 1, i):
				if i < spf[j]:
					spf[j] = i
	return
mod = 10 ** 9 + 7

def get_quasi(n, qsi):
	if n > 10 ** 6:
		return
	qsi.append(n)
	get_quasi(n * 10, qsi)
	get_quasi(n * 10 + 1, qsi)
	return

def solve():
	n = II()
	qsi = []
	get_quasi(1, qsi)
	qsi.sort()
	dp = [sys.maxsize for i in range(n + 1)]
	dct = defaultdict(list)
	dp[0] = -99
	dct[1] = [1]
	dp[1] = 1
	for i in range(2, n + 1):
		for j in range(64):
			if i - qsi[j] >= 0 and dp[i] > dp[i - qsi[j]] + 1:
				if i - qsi[j] > 0:
					dp[i] = dp[i - qsi[j]] + 1
					dct[i] = dct[i - qsi[j]] + [qsi[j]]
				else:
					dp[i] = 1
					dct[i] = [i]
	P(len(dct[n]))
	print(*dct[n])
t = 1
for i in range(t):
	solve()


n = int(input())
tn = n
arr = [0] * 10
i = 1
while tn:
	val = tn % 10
	tn //= 10
	for j in range(val):
		arr[j] += i
	i *= 10
j = 9
while arr[j] == 0:
	j -= 1
print(j + 1)
for _ in range(j + 1):
	print(arr[_])


def answer(n):
	ans = []
	nl = list(str(n))
	nln = []
	for e in nl:
		nln.append(int(e))
	while max(nln) > 0:
		t = []
		for i in range(len(nln)):
			if nln[i] >= 1:
				t.append('1')
				nln[i] -= 1
			else:
				t.append('0')
		ans.append(''.join(t))
	ansn = []
	for e in ans:
		ansn.append(int(e))
	print(len(ansn))
	print(' '.join(map(str, ansn)))
	return

def main():
	n = int(input())
	answer(n)
	return
main()


n = int(input())
a = [0] * 10
t = 1
m = 1
while n > 0:
	d = n % 10
	for i in range(d):
		a[i] += t
	n //= 10
	t *= 10
	m = max(m, d)
print(m)
for i in a:
	if i != 0:
		print(i, end=' ')


n = list(map(int, input()))
m = max(n)
print(m)
for j in range(m):
	l = []
	for i in n:
		if i > j:
			l.append(str(1))
		else:
			l.append(str(0))
	print(int(''.join(l)))


from collections import Counter
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys
import sys
import math
n = int(input())
print(max(str(n)))
while n:
	b = ''.join(['1' if i > '0' else '0' for i in str(n)])
	n = n - int(b)
	print(b, end=' ')


n = list(reversed(input()))
outs = [0] * 9
for i in range(len(n)):
	for x in range(int(n[i])):
		outs[x] += 10 ** i
outs = list(filter(None, outs))
print(len(outs))
print(*outs)


from sys import stdin
stdin.readline

def mp():
	return list(map(int, stdin.readline().strip().split()))

def it():
	return int(stdin.readline().strip())
n = it()
v = []
while n > 0:
	temp = n
	m = 0
	p = 1
	while temp:
		rem = temp % 10
		temp //= 10
		if rem != 0:
			m += p
		p *= 10
	v.append(m)
	n -= m
print(len(v))
print(*v)


import copy
n = list(map(int, input()))
k = len(n)
m = max(n)
b = list()
c = list()
t = 0
while t < int(m):
	for i in range(0, k):
		if int(n[i]) > 0:
			c.append('1')
			n[i] = n[i] - 1
		elif int(n[i]) == 0:
			c.append('0')
	c = ''.join(c)
	c = int(c)
	b.append(c)
	c = list()
	t = t + 1
print(len(b))
print(*b)


import operator
a = [int(i) for i in list(input())]
ret = []
while a.count(0) != len(a):
	cur = list(map(lambda x: 1 if x > 0 else 0, a))
	ret.append(''.join((str(e) for e in cur)).lstrip('0'))
	a = list(map(operator.sub, a, cur))
print(len(ret))
print(' '.join(ret))


import sys
input = sys.stdin.readline
from math import log2, log, ceil

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return res

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]
spf_sieve()

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
n = input().strip()
ans = []
while int(n) > 0:
	x = '1'
	for i in range(1, len(n)):
		if int(n[i]) > 0:
			x += '1'
		else:
			x += '0'
	ans.append(x)
	n = str(int(n) - int(x))
print(len(ans))
print(*ans)


ans = []

def minQuasi(n):
	if n <= 0:
		return
	m = ''.join((min(i, '1') for i in str(n)))
	minQuasi(n - int(m))
	ans.append(m)
n = int(input())
minQuasi(n)
print(len(ans))
print(*ans)


n = input()
a = [int(c) for c in n]
m = max(a)
print(m)
for i in range(m):
	s = ''
	for (j, c) in enumerate(a):
		if s or c:
			s += '1' if c > 0 else '0'
		if c:
			a[j] -= 1
	print(s, end=' ')


n = int(input())
ans = []
while n:
	sol = 0
	val = 1
	k = n
	while k:
		if k % 10:
			sol += val
		k = k // 10
		val *= 10
	ans.append(sol)
	n -= sol
print(len(ans))
for i in ans:
	print(i, end=' ')


a = input()
count = 0
mass = []
for i in range(len(a)):
	mass.append(a[i])
strings = []

def number(mass):
	string = ''
	for i in range(len(mass)):
		join = ''.join
		if mass[i] != '0':
			mass[i] = str(int(mass[i]) - 1)
			string = join([string, '1'])
		else:
			string = join([string, '0'])
	return (string, mass)
for i in range(max(list(map(int, mass)))):
	new_mass = mass
	(temp, new_mass) = number(new_mass)
	strings.append(temp)
	count += 1
print(count)
if not strings:
	strings.append(0)
strings = list(map(int, strings))
print(' '.join(map(str, strings)))


a = int(input())
b = a
n = 0
sp = []
kol = 0
maxi = 0
while b > 0:
	k = b % 10
	if k > maxi:
		maxi = k
	sp.append(k)
	n += 1
	b = b // 10
print(maxi)
s = 0
for i in range(maxi):
	for j in range(n):
		if sp[j] > 0:
			sp[j] -= 1
			s += 10 ** j
	print(s, end=' ')
	s = 0


def main():
	n = [int(i) for i in input()]
	number = max(n)
	print(number)
	for i in range(number):
		k = []
		for j in n:
			if j > i:
				k.append(1)
			elif k:
				k.append(0)
		print(''.join((str(i) for i in k)), end=' ')
	print()
main()


s = input().strip()
arr = []
while s:
	s = str(s)
	x = ''.join(['1' if i != '0' else '0' for i in s])
	s = int(s)
	s -= int(x)
	arr.append(x)
print(len(arr))
print(*arr)


import sys, os.path
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
n = input()
ans = []
no = int(n)
while no > 0:
	temp = ''
	for i in range(len(n)):
		a = int(n[i])
		if a >= 1:
			temp += '1'
		else:
			temp += '0'
	no = int(n) - int(temp)
	n = str(no)
	ans.append(temp)
print(len(ans))
print(*ans)


p = int(input())
a = [int(x) for x in str(p)]
(n, m) = (len(a), max(a))
ans = [['0'] * n for i in range(m)]
for i in range(n):
	for j in range(a[i]):
		ans[j][i] = '1'
print(m)
print(*[int(''.join(ans[i])) for i in range(m)])


fast = lambda : stdin.readline().strip()
zzz = lambda : [int(i) for i in fast().split()]
(z, zz) = (input, lambda : list(map(int, z().split())))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from re import *
from sys import *
from math import *
from heapq import *
from queue import *
from bisect import *
from string import *
from itertools import *
from collections import *
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from collections import Counter as cc
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def output(answer):
	stdout.write(str(answer))
arr = fast()
mx = int(max(arr))
print(mx)
for i in range(mx):
	s = ''
	for j in arr:
		if int(j) > i:
			s += '1'
		else:
			s += '0'
	print(int(s))


import sys
MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
from collections import *
nm = ii()

def decimalToBinary(n):
	return bin(n).replace('0b', '')
k = []
for i in range(1, 65):
	k.append(int(decimalToBinary(i)))
dp = [sys.maxsize] * (nm + 1)
tb = [0] * (nm + 1)
dp[0] = 0
for i in range(1, nm + 1):
	for j in range(0, 64):
		if k[j] <= i:
			dp[i] = min(dp[i], dp[i - k[j]] + 1)
			if dp[i] == dp[i - k[j]] + 1:
				tb[i] = k[j]
print(dp[nm])
curr = nm
while curr > 0:
	print(tb[curr], end=' ')
	curr = curr - tb[curr]


n = int(input())
arr = [1]
for x in arr:
	z = x * 10
	if z <= n:
		arr.append(z)
	z += 1
	if z <= n:
		arr.append(z)
dp = [10 ** 9] * (n + 1)
last = [-1] * (n + 1)
dp[0] = 0
for i in range(n):
	for x in arr:
		if i + x <= n:
			if dp[i + x] > dp[i] + 1:
				dp[i + x] = dp[i] + 1
				last[i + x] = x
x = n
ans = []
while x > 0:
	ans.append(str(last[x]))
	x -= last[x]
print(len(ans))
print(' '.join(ans[::-1]))


def get_data(data):
	return data[0]

def get_answer(value):
	res = 0
	l = [(int(value[i]), i) for i in range(len(value))]
	l.sort(key=get_data)
	inc = 0
	iszero = {-1}
	answer = []
	for data in l:
		res = ''
		for j in range(len(value)):
			if j not in iszero:
				res += str(1)
			else:
				res += str(0)
		res = int(res)
		for i in range(data[0] - inc):
			answer.append(res)
		inc += data[0] - inc
		iszero.add(data[1])
	print(inc)
	for i in answer:
		print(i, end=' ')
value = input()
get_answer(value)


s = input()
l = []
for i in range(len(s)):
	l.append(s[i])
c = max(l)
print(c)
for _ in range(int(c)):
	m = ''
	for i in range(len(s)):
		if l[i] == '0' or l[i] == 0:
			m += '0'
		else:
			m += '1'
			l[i] = int(l[i]) - 1
	print(int(m), end=' ')


n = input()
le = len(n)
l = [sum((10 ** (le - 1 - i) if int(y) >= x else 0 for (i, y) in enumerate(n))) for x in range(1, 10)]
l = sorted([str(x) for x in l if x > 0])
print(len(l))
print(' '.join(l))


n = input()
if n == 0:
	print(1)
	print(0)
else:
	a = []
	t = 0
	for i in n:
		t = max(t, int(i))
		a = [int(i)] + a
	print(t)
	while a != [0] * len(n):
		ch = 9999999
		pn = 0
		for i in range(len(a)):
			if a[i] > 0:
				a[i] -= 1
				pn += 10 ** i
		print(pn, end=' ')


n = int(input())

def f(k):
	(b, c) = (0, 10)
	for _i in range(7):
		i = 10 ** _i
		if int(k / i) % 10:
			b += i
			c = min(c, int(k / i) % 10)
	return (b, c)
l = []
while n > 0:
	l.append(f(n))
	n -= l[-1][0] * l[-1][1]
print(sum(map(lambda x: x[1], l)))
print(' '.join(map(lambda x: ' '.join([str(x[0])] * x[1]), l)))


n = int(input())
ans = []
while n:
	t = 0
	for i in range(len(str(n))):
		if n // 10 ** i % 10:
			t += 10 ** i
	ans.append(str(t))
	n -= t
print('{0}\n{1}'.format(len(ans), ' '.join(ans)))


import sys
input = sys.stdin.readline

def is_quasi(num):
	return all((c == '1' or c == '0' for c in str(num)))
num = int(input())
res = []
while not is_quasi(num):
	snum = str(num)
	new_num = []
	for c in snum:
		if c == '0':
			new_num.append('0')
		else:
			new_num.append('1')
	new_num = int(''.join(new_num))
	res.append(new_num)
	num -= new_num
if num != 0:
	res.append(num)
print(len(res))
print(*res)


def kvbin(sd):
	for i in range(len(sd)):
		if sd[i] != '1' and sd[i] != '0':
			sd = sd[:i] + '1' + sd[i + 1:]
	return sd
n = int(input())
s = str(n)
for i in range(len(s)):
	if s[i] != '1' and s[i] != '0':
		s = s[:i] + '1' + s[i + 1:]
ans = []
while n != 0:
	s = kvbin(str(n))
	sint = int(s)
	s = str(sint)
	ans.append(s)
	n -= sint
print(len(ans))
for i in ans:
	print(i, end=' ')


n = input().strip()
a = list(n)
c = [int(i) for i in a]
results = []
while sum(c) > 0:
	qb = [0 for i in range(len(c))]
	for i in range(len(c)):
		if c[i] > 0:
			qb[i] = 1
			c[i] -= 1
	qbs = int(''.join([str(c) for c in qb]))
	results.append(qbs)
print(len(results))
print(' '.join([str(num) for num in results]))