Eighth-grader Vova is on duty today in the class. After classes, he went into the office to wash the board, and found on it the number n. He asked what is this number and the teacher of mathematics Inna Petrovna answered Vova that n is the answer to the arithmetic task for first-graders. In the textbook, a certain positive integer x was given. The task was to add x to the sum of the digits of the number x written in decimal numeral system.

Since the number n on the board was small, Vova quickly guessed which x could be in the textbook. Now he wants to get a program which will search for arbitrary values of the number n for all suitable values of x or determine that such x does not exist. Write such a program for Vova.


-----Input-----

The first line contains integer n (1 ≤ n ≤ 10^9).


-----Output-----

In the first line print one integer k — number of different values of x satisfying the condition. 

In next k lines print these values in ascending order.


-----Examples-----
Input
21

Output
1
15

Input
20

Output
0



-----Note-----

In the first test case x = 15 there is only one variant: 15 + 1 + 5 = 21.

In the second test case there are no such x.

Difficulty: competition

Starter code:

Solutions:
n=int(input())
q=[]
for i in range(max(0,n-100),n+1):
	j=i
	res=i
	while j:
		res+=j%10
		j//=10
	if res==n:
		q.append(i)
print(len(q))
for i in q:
	print(i)

n = int(input())
ans = set()
f = lambda x: sum(int(i) for i in str(x))
for i in range(max(0, n - 1000), n + 1):
    if i + f(i) == n: ans.add(i)
print(len(ans))
for i in sorted(ans): print(i)

n = int(input())
a = []
for i in range(min(n, 82), -1, -1):
	c = n - i
	c += sum([int(j) for j in str(c)])
	if c == n:
		a.append(n - i)
print(len(a))
for i in a:
	print(i)

n = int(input())
ans = []
for s in range(1, min(n + 1, 99)):
    x = n - s
    sm = sum(int(i) for i in str(x))
    if sm == s:
        ans.append(x)
print(len(ans))
for i in sorted(ans):
    print(i, end=' ')

#!/usr/bin/env python3
n = int(input())

ans = []
for i in range(0, 90):
    x = n - i
    if x <= 0: continue

    ds = 0
    s = str(x)
    for c in s:
        ds += ord(c) - ord('0')
    if ds == i:
        ans.append(x)
ans = sorted(ans)

print(len(ans))
print(' '.join(map(str, ans)))


# Author: lizi
# Email: lzy960601@outlook.com

import sys
import math

n = int(input())
ans = []
for i in range(min(n,100)):
    p = n - i
    s = p
    while p > 0:
        s += p % 10
        p = p // 10
    #print(s,' ',p)
    if s == n:
        ans.append( n - i );
print(len(ans))
ans.sort()
for x in ans:
    print(x)



def summ(x):
    return sum([int(i) for i in str(x)])

n = int(input())
ans = []
for i in range(max(1, n - 200), n):
    if i + summ(i) == n:
        ans.append(i)
print(len(ans))
print(*ans)

n = int(input())
ans = [i for i in range(max(0, n - 100), n) if i + sum(int(j) for j in str(i)) == n]
print(len(ans), '\n' + '\n'.join(map(str, ans)))

def summ(n):
  s = 0
  for i in str(n): s+=int(i);
  return s

n, count, a = int(input()), 0, []
for i in range(max(1, n-81), n):
  if summ(i)+i==n:
    count+=1
    a.append(i)
print(count)
for i in a: print(i);

def main():
    n = int(input())
    results = foo(n)
    print(len(results))
    for i in results:
        print(i)


def foo(n):
    results = []
    min_border = n - len(str(n)) * 9

    for i in range(max(min_border, 0), n):
        if i + sum_of_digits(i) == n:
            results.append(i)
    return results


def sum_of_digits(n, result=0):
    while n > 0:
        result += (n % 10)
        n = n // 10
    return result


def test1():
    assert foo(21) == [15]


def test2():
    assert foo(20) == []


def test3():
    foo(1000000)


def __starting_point():
    main()

__starting_point()

while True:
    try:
        n = input()
        arr = []
        n = int(n)
        start = int(n - 100)
        if start <= 0:
            start = int(1)

        counter = int(0)
        for i in range(start,n):
            tp = int(i)
            ans = int(0)
            while tp != 0:
                ans += int(tp % 10)
                tp /= 10

            ans += int(i)

            if ans == n:
                counter += 1
                arr.append(int(i))

        if counter == 0:
            print(0)
        else:
            print(counter)
            for i in range(0,counter):
                print(arr[i])

    except:
        break

n = int(input())


def digits(v):
    s = 0
    while v > 0:
        s += v % 10
        v //= 10
    return s


a = []
for x in range(max(0, n - 81), n):
    if x + digits(x) == n:
        a.append(x)

print(len(a))
if len(a) > 0:
    print(" ".join(map(str, a)))




n=int(input())
m=[]
if n<=18:
    a=0
else:
    a=n-len(str(n))*9
for i in range(a,n):
    x=i
    for j in str(i):
        x+=int(j)
    if n==x:
        m.append(i)
print(len(m))
[print(i) for i in m]

n = int(input())
x = n
z = 0
t = 0
fty = []
for i in range(min(1000,n)):
	z = 0
	x = str(x)
	for j in range(len(x)):
		z += int(x[j])
	x = int(x)
	if (x + z) == n:
		t += 1
		fty += [x]
	x -= 1
fty.sort()
if t == 0:
	print(t)
else:
	print(t)
	for i in fty:
		print(i)


n = int(input())
x = n
z = 0
t = 0
fty = []
for i in range(min(10000,n)):
	z = 0
	x = str(x)
	for j in range(len(x)):
		z += int(x[j])
	x = int(x)
	if (x + z) == n:
		t += 1
		fty += [x]
	x -= 1
fty.sort()
if t == 0:
	print(t)
else:
	print(t)
	for i in fty:
		print(i)


n = int(input())
p = 0 if n<=100 else n-100
ans =[]
while p <= n:
    k = p
    s = p
    while k>0:
        s += k%10
        k = k//10
    if s == n:
        ans.append(p)
    p += 1
if len(ans) == 0:
    print(0)
else:
    print(len(ans))
    for i in ans:
        print(i,end=' ')

n = int(input())
p = 0 if n<=100 else n-100
ans =[]
while p <= n:
    k = p
    s = p
    while k>0:
        s += k%10
        k = k//10
    if s == n:
        ans.append(p)
    p += 1
if len(ans) == 0:
    print(0)
else:
    print(len(ans))
    for i in ans:
        print(i)

n = int(input())
p = 0 if n<=100 else n-100
ans =[]
while p <= n:
    k = p
    s = p
    while k>0:
        s += k%10
        k = k//10
    if s == n:
        ans.append(p)
    p += 1
print(len(ans))
for i in ans:
    print(i)

n = int(input())
def digit_sum(x):
    if x<0:
        return 0
    res = 0
    while x: 
        res += x%10
        x = x // 10
    return res

res = []
for i in range(200):
    m = n-i
    if digit_sum(m) == i:
        res.append(m)

print(len(res))
while res:
    print(res.pop())


n=int(input())
x=0
L=[]
if n>100:
    for i in range(n-81,n):
        s=i%10
        for j in range(1,10):
            s+=((i//(10**j))%10)
        if i+s==n:
            x+=1
            L.append(i)
elif n<101:
    for i in range(1,n):
        s=i%10+i//10
        if i+s==n:
            x+=1
            L.append(i)
if L==[]:
    print(0)
else:
    print(x)
    for i in L:
        print(i)
            
    


def sum_digits(n):
    ans = 0
    while n > 0:
        ans += n % 10
        n = n // 10
    return ans

n = int(input())
ans = []
for i in range(max(1, n - 1000), n + 1):
    if (i + sum_digits(i) == n):
        ans.append(i)
print(len(ans))
for elem in ans:
    print(elem)


a = int(input())

l = []

for i in range(1,81):
    s = 0
    for j in range(len(str(abs(a - i)))):
        s = s + int(str(abs(a-i))[j])
    if s == i:
        l.append(a-i)

l.sort()
print(len(l))
for i in range(len(l)):
    print(l[i])


n=int(input())
ans=0
l=[]
for m in range(max(n-82,1),n):
    #print(m)
    if m+sum(map(int,[d for d in str(m)]))==n:
        ans+=1
        l.append(m)
print(ans)
for d in l:
    print(d)

n = int(input())

def digit_sum(n):
    s = 0
    while n > 0:
        s += n % 10
        n //= 10
    return s

def digit_count(n):
    count = 0
    while n > 0:
        count += 1
        n //= 10
    return count

x_count = 0
x_list = []
for x in range(n - 9 * digit_count(n), n + 1):
    if x + digit_sum(x) == n:
        x_list.append(x)
        x_count += 1

print(x_count)
for x in x_list:
    print(x)


a = int(input().strip())

imin = max(0, a - 81)

l = []

for i in range(imin, a):
	x = list(str(i))
	s = 0
	for xx in x:
		s += int(xx)
	if s + i == a:
		l.append(i)

print(len(l))
for e in l:
	print(e)