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.

The first line contains integer n (1 ≤ n ≤ 109).

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.

NoteIn 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.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Text;
using System.Diagnostics;
namespace contest1
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console.SetIn(new StreamReader("input.txt"));
            solve_442C();
        }

        public static void solve_442C()
        {
            List<int> results = new List<int>();
            int n = Convert.ToInt32(Console.ReadLine());
            int sub = n >= 100 ? 100 : n;

            int start = n - sub;
            int sum = 0;
            while (start <= n)
            {
                int x = start;
                sum = 0;
                while (x > 0)
                {
                    sum += x % 10;
                    x /= 10;
                }
                if (n == start + sum)
                {
                    results.Add(start);
                }
                start++;
            }

            Console.WriteLine(results.Count);
            if (results.Count > 0)
            {
                for (int k = 0; k < results.Count; k++)
                {
                    Console.WriteLine(results[k]);
                }
            }
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;
using System.Diagnostics;

class Scanner
{
    private readonly char Separator = ' ';
    private int Index = 0;
    private string[] Line = new string[0];
    public string Next()
    {
        if (Index >= Line.Length)
        {
            Line = Console.ReadLine().Split(Separator);
            Index = 0;
        }
        var ret = Line[Index];
        Index++;
        return ret;
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    private long NextLong()
    {
        return long.Parse(Next());
    }
}

class Magatro
{
    private int N;
    private void Scan()
    {
        var sc = new Scanner();
        N = sc.NextInt();
    }

    private int Sum(int n)
    {
        if (n <= 9)
        {
            return n;
        }
        else
        {
            return n % 10 + Sum(n / 10);
        }
    }

    public void Solve()
    {
        Scan();
        var sb = new StringBuilder();
        int cnt = 0;
        for (int i = 100; i >= 0; i--)
        {
            int a = N - i;
            if(Sum(a)==i)
            {
                cnt++;
                sb.AppendLine(a.ToString());
            }
        }
        Console.WriteLine(cnt);
        if(cnt!=0)
        {
            Console.Write(sb.ToString());
        }
    }

    static public void Main()
    {
        new Magatro().Solve();
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace ConsoleApp2
{
    class Program
    {

        static void Main(string[] args)
        {
            int n,q=0;
            List<int> l = new List<int>();
            n=Int32.Parse(Console.ReadLine());
            string s="";
            for(int i=n-100;i<=n;i++)
            {
                s = i+"";
                int x = 0;
                for(int j=0;j<s.Length;j++)
                {
                    x += s[j] - '0';
                }
                if(i+x==n)
                {
                    q++;
                    l.Add(i);
                }
            }
            Console.WriteLine(q);
            for(int i=0;i<l.Count;i++)
            {
                Console.Write(l[i]+" ");
            }

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace CSharp
{
    public class _875A
    {
        public static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            var result = new List<int>();

            for (int i = Math.Max(1, n - 81); i <= n; i++)
            {
                if (i + i.ToString().Sum(d => d - '0') == n)
                {
                    result.Add(i);
                }
            }

            Console.WriteLine(result.Count);

            foreach (int i in result)
            {
                Console.WriteLine(i);
            }
        }
    }
}

using System;

namespace JustForFun
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            int digit = 0;
            int[] resultSet = new int[1000];
            int min;
            string line = Console.ReadLine();
            n = Convert.ToInt32(line);
            int tmp = n;
            while (tmp > 9)
            {
                tmp /= 10;
                digit++;
            }
         //   Console.WriteLine(digit);
            min = Math.Max(n - 9 * digit - 9, 1);
            int itr = 0;
            for(int i = 0; i <= n; i++)
            {
                int result = n -i;
                if (result < min)
                    break;
                int tmpt = n - i;
                while(tmpt > 0)
                {
                    result += tmpt % 10;
                    tmpt /= 10;
                }
                //Console.WriteLine(result);
                if(result == n)
                {
                    resultSet[itr++] = n - i;
                }
            }
            Console.WriteLine(itr);
            while (itr > 0)
            {
                Console.WriteLine(resultSet[--itr]);
            }
           // Console.ReadKey();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Дежурство
{
    class Program
    {
        static int SumOfNums(int x)
        {
            int sum = 0;
            string s = Convert.ToString(x);
            for (int i = 0; i < s.Length; i++)
            {
                sum += Convert.ToInt32(Convert.ToString(s[i]));
            }

            return sum;
        }
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());

            int x = 0;

            if (n > 100) x = n - 100;
            else x = 0;
            List<int> nums = new List<int>();
            while (x < n)
            {
                if (x + SumOfNums(x) == n) nums.Add(x);
                x++;
            }

            Console.WriteLine(nums.Count);
            for (int i = 0; i < nums.Count; i++) Console.WriteLine(nums[i]);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeForces
{
   class A
   {
      static void Main(string[] args)
      {
        List<int> L = new List<int>();
         int n = int.Parse(Console.ReadLine());
         int to  = (n>100)?n-100:0;
         for(int i=n-1;i>=to;i--){
           if(i + GetSum(i)==n){
              L.Add(i);
           }
         }
         L.Sort();
         Console.WriteLine(L.Count);
         for(int i=0;i<L.Count;i++){
           Console.Write(L[i] + " ");
         }
      }

      static int GetSum(int n){
         int sum = 0;
         string s = n+"";
         for(int i=0;i<s.Length;i++){
           sum += (int)Char.GetNumericValue(s[i]);
         }
         return sum;

      }
   }

}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace nolifer
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> nums = new List<int>();
            int a = Convert.ToInt32(Console.ReadLine());
            for (int i = 0; i <= 9 * a.ToString().Length; i++)
            {

                int b = a - i;
                if (b >= 0)
                {
                    string c = b.ToString();
                    for (int j = 0; j < c.Length; j++)
                    {
                        b += Convert.ToInt32(c[j].ToString());

                    }

                    if (b == a)
                    {
                        nums.Add(Convert.ToInt32(c));
                    }
                }
            }
            Console.WriteLine(nums.Count);
            nums.Sort();
            foreach (int w in nums)
            {
                Console.WriteLine(w);
            }

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    public class RandomMath
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
			List<int> Solutions = new List<int>();
			int HowMuch = 0;
			int CheckThis;
			int[] Digits;
			CheckThis = n <= 81 ? 0 : n - 81;
			for (int x = CheckThis; x < n; x++)
			{
				Digits = x.ToString().Select(t => int.Parse(t.ToString())).ToArray();
				int DigitsValue = 0;
				foreach (int dig in Digits)
				{
					DigitsValue += dig;
				}
				if (x + DigitsValue == n)
				{
					HowMuch += 1;
					Solutions.Add(x);

				}
			}
			Console.WriteLine(HowMuch);
			foreach(int Solution in Solutions)
			{
				Console.WriteLine(Solution);
			}
        }
    }
}

using System;
using System.Collections.Generic;

namespace LovNaSataniste
{
    class Program
    {
        static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            int i, sum, current;
            List<int> xes = new List<int>();
            for (i = n < 81 ? 0 : n - 81; i < n; i++)
            {
                for (current = sum = i; current != 0; current /= 10) sum += current % 10;
                if (n == sum) xes.Add(i);
            }
            Console.WriteLine(xes.Count);
            foreach (int x in xes) Console.WriteLine(x);
        }
    }
}

using System;
using System.Collections.Generic;

namespace Z3
{
    class Program
    {
        static void Main(string[] args)
        {
            int num = int.Parse(Console.ReadLine());
            List<int> output = new List<int>();
            int sum, current, i;

            for (i = num < 81 ? 0 : num - 81; i < num; i++)
            {
                for (current = sum = i; current != 0; current /= 10)
                    sum += current % 10;

                if (num == sum)
                    output.Add(i);
            }

            Console.WriteLine(output.Count);

            for (i = 0; i < output.Count; i++)
                Console.WriteLine(output[i]);
        }
    }
}

using System;
using System.Collections.Generic;

class Program
{
    private static void Main(string[] args)
    {
        int inputNumber = Int32.Parse(Console.ReadLine());
        List<int> findedNumbers = new List<int>();

        int startPosition = inputNumber < 1000000 ? inputNumber / 10 : inputNumber - 100;

        for (int i = startPosition; i < inputNumber; i++)
        {
            char[] parsedInputNumber = i.ToString().ToCharArray();
            int digitSum = 0;

            for (int j = 0; j < parsedInputNumber.Length; j++)
            {
                digitSum += Int32.Parse(parsedInputNumber[j].ToString());
            }

            int currentVariant = i + digitSum;

            if (currentVariant == inputNumber)
            {
                findedNumbers.Add(i);
            }
        }

        Console.WriteLine(findedNumbers.Count);

        if (findedNumbers.Count > 0)
        {
            foreach (var findedNumber in findedNumbers)
            {
                Console.WriteLine(findedNumber);
            }
        }
        Console.ReadLine();
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Classroom_Watch
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            Solve(args);
            writer.Flush();
        }

        private static void Solve(string[] args)
        {
            int n = Next();

            var nn = new List<int>();
            for (int i = n - 1; i >= 1; i--)
            {
                int sum = 0;
                int t = i;
                int count = 0;
                while (t > 0)
                {
                    sum += t%10;
                    t /= 10;
                    count++;
                }
                if (i + sum == n)
                    nn.Add(i);

                if (i + 9*count < n)
                    break;
            }

            nn.Sort();
            writer.WriteLine(nn.Count);
            foreach (int i in nn)
            {
                writer.WriteLine(i);
            }
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;

namespace Testing
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Convert.ToInt32(Console.ReadLine());
            List<int> values = new List<int>();
            int quantity = 0;
            for(int currentValue = n; currentValue > n - 100 && currentValue > 0; currentValue--)
            {
                int temporaryValue = currentValue;
                int sum = currentValue;
                while(temporaryValue > 0)
                {
                    sum += temporaryValue % 10;
                    temporaryValue /= 10;
                }
                if(sum == n)
                {
                    quantity++;
                    values.Add(currentValue);
                }
            }
            Console.WriteLine(quantity);
            values.Sort();
            foreach(int value in values)
            {
                Console.WriteLine("{0}", value);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;

namespace CF
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            using (var sr = new InputReader(Console.In))
//			using (var sr = new InputReader(new StreamReader("input.txt")))
            using (var sw = Console.Out)
                //using (var sw = new StreamWriter("output.txt"))
            using (var task = new Task(sr, sw)) {
                task.Solve();
//                Console.ReadKey();
            }
        }
    }

    internal class Task : IDisposable
    {
        private readonly InputReader sr;
        private readonly TextWriter sw;
        private bool isDispose;

        public Task(InputReader sr, TextWriter sw)
        {
            this.sr = sr;
            this.sw = sw;
        }

        public void Solve()
        {
            var n = sr.NextInt64();
            var max = (long) 1e3;
            var count = 0;
            var answer = new StringBuilder();
            for (var i = n; i <= n + max; i++) {
                var str = i.ToString();
                var sum = i;
                for (var j = 0; j < str.Length; j++) {
                    sum += str[j] - '0';
                }
                if (sum == n) {
                    answer.Append(str + " ");
                    count++;
                }
            }
            for (var i = n - max; i < n; i++) {
                var str = i.ToString();
                var sum = i;
                for (var j = 0; j < str.Length; j++) {
                    sum += str[j] - '0';
                }
                if (sum == n) {
                    answer.Append(str + " ");
                    count++;
                }
            }

            sw.WriteLine(count);
            sw.Write(answer);
        }

        ~Task()
        {
            Dispose(false);
        }

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        private void Dispose(bool disposing)
        {
            if (!isDispose) {
                if (disposing) {
                    if(sr != null)
                        sr.Dispose();

                    if(sw != null)
                        sw.Dispose();
                }

                isDispose = true;
            }
        }
    }
}

internal class InputReader : IDisposable
{
    private bool isDispose;
    private readonly TextReader sr;
    private string[] buffer;
    private int seek;

    public InputReader(TextReader stream)
    {
        sr = stream;
    }

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    public string NextString()
    {
        var result = sr.ReadLine();
        return result;
    }

    public int NextInt32()
    {
        return Int32.Parse(ReadNextToken());
    }

    private string ReadNextToken()
    {
        if (buffer == null || seek == buffer.Length) {
            seek = 0;
            buffer = NextSplitStrings();
        }

        return buffer[seek++];
    }

    public long NextInt64()
    {
        return Int64.Parse(ReadNextToken());
    }

    public int[] ReadArrayOfInt32()
    {
        return ReadArray(Int32.Parse);
    }

    public long[] ReadArrayOfInt64()
    {
        return ReadArray(Int64.Parse);
    }

    public string[] NextSplitStrings()
    {
        return NextString()
            .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
    {
        return NextSplitStrings()
            .Select(s => func(s, CultureInfo.InvariantCulture))
            .ToArray();
    }

    public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
    {
        return
            str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                .Select(s => func(s, CultureInfo.InvariantCulture))
                .ToArray();
    }

    protected void Dispose(bool dispose)
    {
        if (!isDispose)
        {
            if (dispose)
                sr.Close();

            isDispose = true;
        }
    }

    ~InputReader()
    {
        Dispose(false);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace prog1
{
    class Program
    {
        static void Main(string[] args)
        {
            //string a = Console.ReadLine();
            int n = int.Parse(Console.ReadLine());
            string m = n.ToString();
            int current = 0;
            int ans = 0;
            string an = "";
            current = n - (9*m.Length);
            if(current<0)
            {
                current = 0;
            }
            int s = 0;
            int summ = 0;
            int g = 0;
            /*string v = current.ToString();
            for(int i = 0; i<v.Length; i++)
            {
                summ+=int.Parse(v[i].ToString());
            }*/
            while(current<n)
            {

                /*g++;
                if(g>9)
                {
                    g=0;
                    summ-=8;
                    Console.WriteLine(summ);
                }
                else
                {
                    summ++;
                }*/
                summ = 0;
                string v = current.ToString();
            for(int i = 0; i<v.Length; i++)
            {
                summ+=int.Parse(v[i].ToString());
            }
            s=current+summ;

                if(s==n)
                {
                ans++;
                an+=current.ToString();
                an+=" ";
                }
                current++;

            }
            var a1 = an.Split(' ');
            Console.WriteLine(ans);
            for(int i = 0; i<a1.Length-1; i++)
            {
            Console.WriteLine(a1[i]);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace ConsoleApp9
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine();
            var n = s.I();
            int sum = 0;
            for (int i = Math.Max(0,n - 2*s.Length * 10); i < n; i++)
            {
                if (S(i) == n)
                {
                    H.A(i);
                    sum++;
                }
            }
            Console.WriteLine(sum);
            Console.Write(H.Str());
        }
        static int S(int n)
        {
            var t = n;
            var k = n;
            while (k != 0)
            {
                t += k % 10;
                k = k / 10;
            }
            return t;
        }
    }
    static class H
    {
        public static int I(this string str)
        {
            return int.Parse(str);
        }

        public static StringBuilder builder = new StringBuilder();

        public static void A(object a)
        {
            builder.Append(a);
            builder.Append("\n");
        }

        public static string Str()
        {
            return builder.ToString();
        }
        static IEnumerable<int> Read(TextReader rdr)
        {
            int ch;
            bool neg = false;
            int value = 0;
            int count = 0;

            while (-1 != (ch = rdr.Read()))
            {
                if (ch == 9 || ch == 10 || ch == 13 || ch == 32)
                {
                    if (count > 0)
                        yield return neg ? -value : value;
                    count = 0;
                    value = 0;
                    neg = false;
                }
                else if (count == 0 && ch == '-')
                {
                    neg = true;
                }
                else if (ch >= '0' && ch <= '9')
                {
                    count++;
                    value = value * 10 + (ch - '0');
                }
                else
                    throw new InvalidDataException();
            }

            if (count > 0)
                yield return neg ? -value : value;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        var s = new List<int>();

        int maxAdd = 9 + 9 + 9 + 9 + 9 + 9 + 9 + 9 + 9;
        for (var add = maxAdd; add > 0; --add)
        {
            int cand = n - add;
            if (cand <= 0)
                continue;
            if (DigitsSum(cand) != add)
                continue;
            s.Add(cand);
        }
        Console.WriteLine(s.Count);
        if (s.Count > 0)
            Console.WriteLine(string.Join(Environment.NewLine, s));
    }

    static int DigitsSum(int n)
    {
        int sum = 0;
        do
        {
            sum += n % 10;
            n /= 10;
        }
        while (n > 0);
        return sum;
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace nolifer
{
    class Program
    {
        static void Main(string[] args)
        {
            List<string> nums = new List<string>();
            int a = Convert.ToInt32(Console.ReadLine());
            for (int i = 0; i <= 9 * a.ToString().Length; i++)
            {

                int b = a - i;
                if (b >= 0)
                {
                    string c = b.ToString();
                    for (int j = 0; j < c.Length; j++)
                    {
                        b += Convert.ToInt32(c[j].ToString());

                    }

                    if (b == a)
                    {
                        nums.Add(c);
                    }
                }
            }
            Console.WriteLine(nums.Count);
            foreach (string w in nums)
            {
                Console.WriteLine(w);
            }

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Дежурство
{
    class Program
    {
        static int SumOfNums(int x)
        {
            int sum = 0;
            string s = Convert.ToString(x);
            for (int i = 0; i < s.Length; i++)
            {
                sum += Convert.ToInt32(Convert.ToString(s[i]));
            }

            return sum;
        }
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());

            int x = 0;

            if (n > 72) x = n - 72;
            else x = 0;
            List<int> nums = new List<int>();
            while (x < n)
            {
                if (x + SumOfNums(x) == n) nums.Add(x);
                x++;
            }

            Console.WriteLine(nums.Count);
            for (int i = 0; i < nums.Count; i++) Console.WriteLine(nums[i]);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Дежурство
{
    class Program
    {
        static int SumOfNums(int x)
        {
            int sum = 0;
            string s = Convert.ToString(x);
            for (int i = 0; i < s.Length; i++)
            {
                sum += Convert.ToInt32(Convert.ToString(s[i]));
            }

            return sum;
        }
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());

            int x = 0;

            if (n > 72) x = n - 72;
            else x = 0;
            while (x < n && x + SumOfNums(x) != n)
            {
                x++;
            }

            if (x + SumOfNums(x) == n)
            {
                Console.WriteLine(1);
                Console.WriteLine(x);
            }
            else
            {
                Console.WriteLine(0);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace Z3
{
    class Program
    {
        static void Main(string[] args)
        {
            int num = int.Parse(Console.ReadLine());

            if (num < 2)
            {
                Console.WriteLine("0");
                return;
            }
            //else if (num < 10)
            //{
            //    Console.WriteLine("1\n" + (num - 1));
            //    return;
            //}

            List<int> output = new List<int>();
            int res = 1;

            for (int sum = 1, start = 0; res <= num; res++, sum++)
            {
                if (res % 10 == 0)
                {
                    start++;
                    sum = start;
                }

                if (num - res == sum)
                    output.Add(res);
            }

            Console.WriteLine(output.Count);

            for (int i = 0; i < output.Count; i++)
                Console.WriteLine(output[i]);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace Z3
{
    class Program
    {
        static bool Match(int n1, int n2)
        {
            if (n1 < 10)
            {
                if (n1 == n2)
                    return true;
                else
                    return false;
            }

            int res = n1;
            int i = 0;
            int k = n1 % 10;

            while (i <= 9)
            {
                res += k;
                i++;
                k = (int)(n1 / Math.Pow(10, i) % 10);
            }

            if (res == n2)
                return true;
            else
                return false;
        }

        static void Main(string[] args)
        {
            int num = int.Parse(Console.ReadLine());

            //for (num = 1; num <= 1000000000; num++)
            //{
            //    Console.WriteLine(num);

                if (num < 2)
                {
                    Console.WriteLine("0");
                return;
              //      Console.WriteLine("#########");
              //      Thread.Sleep(800);
             //       continue;
                }

                List<int> output = new List<int>();
                int res = 1;

                while (res <= num)
                {
                    if (Match(res, num))
                        output.Add(res);

                    res++;
                }

                Console.WriteLine(output.Count);

                for (int i = 0; i < output.Count; i++)
                    Console.WriteLine(output[i]);

            //    Thread.Sleep(800);
            //    Console.WriteLine("##########");
            //}
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Z3
{
    class Program
    {
        static bool Match(int n1, int n2)
        {
            if (n1 < 10)
            {
                if (n1 == n2)
                    return true;
                else
                    return false;
            }

            int res = n1;
            int i = 0;
            int k = n1 % 10;

            while (i <= 9)
            {
                res += k;
                i++;
                k = (int)(n1 / Math.Pow(10, i) % 10);
            }

            if (res == n2)
                return true;
            else
                return false;
        }

        static void Main(string[] args)
        {
            int num = int.Parse(Console.ReadLine());

            if (num < 10)
            {
                Console.WriteLine("1\n" + num);
                return;
            }

            List<int> output = new List<int>();
            int res = 1;

            while (res <= num)
            {
                if (Match(res, num))
                    output.Add(res);

                res++;
            }

            Console.WriteLine(output.Count);

            for (int i = 0; i < output.Count; i++)
                Console.WriteLine(output[i]);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace Z3
{
    class Program
    {
        static bool Match(int n1, int n2)
        {
            if (n1 < 10)
            {
                if (n1 == n2)
                    return true;
                else
                    return false;
            }

            int res = n1;
            int i = 0;
            int k = n1 % 10;

            while (i <= 9)
            {
                res += k;
                i++;
                k = (int)(n1 / Math.Pow(10, i) % 10);
            }

            if (res == n2)
                return true;
            else
                return false;
        }

        static void Main(string[] args)
        {
            int num = int.Parse(Console.ReadLine());

            //for (num = 1; num <= 1000000000; num++)
            //{
            //    Console.WriteLine(num);

                if (num < 10)
                {
                    Console.WriteLine("0");
                return;
              //      Console.WriteLine("#########");
              //      Thread.Sleep(800);
             //       continue;
                }

                List<int> output = new List<int>();
                int res = 1;

                while (res <= num)
                {
                    if (Match(res, num))
                        output.Add(res);

                    res++;
                }

                Console.WriteLine(output.Count);

                for (int i = 0; i < output.Count; i++)
                    Console.WriteLine(output[i]);

            //    Thread.Sleep(800);
            //    Console.WriteLine("##########");
            //}
        }
    }
}

using System;
using System.Collections.Generic;

class Program
{
    private static void Main(string[] args)
    {
        int inputNumber = Int32.Parse(Console.ReadLine());
        List<int> findedNumbers = new List<int>();

        for (int i = 10; i < inputNumber; i++)
        {
            char[] parsedInputNumber = i.ToString().ToCharArray();

            int firstDigit = Int32.Parse(parsedInputNumber[0].ToString());
            int secondDigit = Int32.Parse(parsedInputNumber[1].ToString());
            int thirdDigit = 0;

            if (i > 99)
            {
                thirdDigit = Int32.Parse(parsedInputNumber[2].ToString());
            }

            int currentVariant = i + firstDigit + secondDigit + thirdDigit;

            if (currentVariant == inputNumber)
            {
                findedNumbers.Add(i);
            }
        }

        Console.WriteLine(findedNumbers.Count);

        if (findedNumbers.Count > 0)
        {
            foreach (int findedNumber in findedNumbers)
            {
                Console.WriteLine(findedNumber);
            }
        }
        Console.ReadLine();
    }
}

using System;
using System.Collections.Generic;

class Program
{
    private static void Main(string[] args)
    {
        string inputData = Console.ReadLine();
        int inputNumber = inputData.Length < 4 ? Int32.Parse(inputData) : 0;

        if (inputNumber > 0 && inputNumber < 110)
        {
            FindNumbers(inputNumber);
        }
        else
        {
            Console.WriteLine(0);
        }

        Console.ReadLine();
    }

    private static void FindNumbers(int inputNumber)
    {
        List<int> findedNumbers = new List<int>();

        for (int i = 1; i < inputNumber; i++)
        {
            char[] parsedInputNumber = i.ToString().ToCharArray();

            int firstDigit = Int32.Parse(parsedInputNumber[0].ToString());
            int secondDigit = 0;
            int thirdDigit = 0;

            if (i > 9)
            {
                secondDigit = Int32.Parse(parsedInputNumber[1].ToString());
            }

            if (i > 99)
            {
                thirdDigit = Int32.Parse(parsedInputNumber[2].ToString());
            }

            int currentVariant = i + firstDigit + secondDigit + thirdDigit;

            if (currentVariant == inputNumber)
            {
                findedNumbers.Add(i);
            }
        }

        Console.WriteLine(findedNumbers.Count);

        if (findedNumbers.Count > 0)
        {
            foreach (var findedNumber in findedNumbers)
            {
                Console.WriteLine(findedNumber);
            }
        }
    }
}

using System;
using System.Collections.Generic;

class Program
{
    private static void Main(string[] args)
    {
        int inputNumber = Int32.Parse(Console.ReadLine());
        List<int> findedNumbers = new List<int>();

        for (int i = 10; i < inputNumber; i++)
        {
            char[] parsedInputNumber = i.ToString().ToCharArray();
            int firstDigit = Int32.Parse(parsedInputNumber[0].ToString());
            int secondDigit = 0;
            int thirdDigit = 0;

            if (i > 9)
            {
                secondDigit = Int32.Parse(parsedInputNumber[1].ToString());
            }

            if (i > 99)
            {
                thirdDigit = Int32.Parse(parsedInputNumber[2].ToString());
            }

            int currentVariant = i + firstDigit + secondDigit + thirdDigit;

            if (currentVariant == inputNumber)
            {
                findedNumbers.Add(i);
            }
        }

        Console.WriteLine(findedNumbers.Count);

        if (findedNumbers.Count > 0)
        {
            foreach (int findedNumber in findedNumbers)
            {
                Console.WriteLine(findedNumber);
            }
        }

        Console.ReadLine();
    }
}

using System;
using System.Collections.Generic;

namespace Testing
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Convert.ToInt32(Console.ReadLine());
            List<int> values = new List<int>();
            int quantity = 0;
            for(int currentValue = n; currentValue > n - 100 && currentValue > 0; currentValue--)
            {
                int temporaryValue = currentValue;
                int sum = currentValue;
                while(temporaryValue > 0)
                {
                    sum += temporaryValue % 10;
                    temporaryValue /= 10;
                }
                if(sum == n)
                {
                    quantity++;
                    values.Add(currentValue);
                }
            }
            Console.WriteLine(quantity);
            foreach(int value in values)
            {
                Console.WriteLine("{0}", value);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;

namespace CF
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            using (var sr = new InputReader(Console.In))
//			using (var sr = new InputReader(new StreamReader("input.txt")))
            using (var sw = Console.Out)
                //using (var sw = new StreamWriter("output.txt"))
            using (var task = new Task(sr, sw)) {
                task.Solve();
//                Console.ReadKey();
            }
        }
    }

    internal class Task : IDisposable
    {
        private readonly InputReader sr;
        private readonly TextWriter sw;
        private bool isDispose;

        public Task(InputReader sr, TextWriter sw)
        {
            this.sr = sr;
            this.sw = sw;
        }

        public void Solve()
        {
            var n = sr.NextInt64();
            var max = (long) 1e3;
            var count = 0;
            for (var i = n; i <= n + max; i++) {
                var str = i.ToString();
                var sum = i;
                for (var j = 0; j < str.Length; j++) {
                    sum += str[j] - '0';
                }
                if (sum == n) {
                    count++;
                }
            }
            for (var i = n - max; i < n; i++) {
                var str = i.ToString();
                var sum = i;
                for (var j = 0; j < str.Length; j++) {
                    sum += str[j] - '0';
                }
                if (sum == n) {
                    count++;
                }
            }

            sw.WriteLine(count);
        }

        ~Task()
        {
            Dispose(false);
        }

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        private void Dispose(bool disposing)
        {
            if (!isDispose) {
                if (disposing) {
                    if(sr != null)
                        sr.Dispose();

                    if(sw != null)
                        sw.Dispose();
                }

                isDispose = true;
            }
        }
    }
}

internal class InputReader : IDisposable
{
    private bool isDispose;
    private readonly TextReader sr;
    private string[] buffer;
    private int seek;

    public InputReader(TextReader stream)
    {
        sr = stream;
    }

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    public string NextString()
    {
        var result = sr.ReadLine();
        return result;
    }

    public int NextInt32()
    {
        return Int32.Parse(ReadNextToken());
    }

    private string ReadNextToken()
    {
        if (buffer == null || seek == buffer.Length) {
            seek = 0;
            buffer = NextSplitStrings();
        }

        return buffer[seek++];
    }

    public long NextInt64()
    {
        return Int64.Parse(ReadNextToken());
    }

    public int[] ReadArrayOfInt32()
    {
        return ReadArray(Int32.Parse);
    }

    public long[] ReadArrayOfInt64()
    {
        return ReadArray(Int64.Parse);
    }

    public string[] NextSplitStrings()
    {
        return NextString()
            .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
    {
        return NextSplitStrings()
            .Select(s => func(s, CultureInfo.InvariantCulture))
            .ToArray();
    }

    public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
    {
        return
            str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                .Select(s => func(s, CultureInfo.InvariantCulture))
                .ToArray();
    }

    protected void Dispose(bool dispose)
    {
        if (!isDispose)
        {
            if (dispose)
                sr.Close();

            isDispose = true;
        }
    }

    ~InputReader()
    {
        Dispose(false);
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace ConsoleApp9
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine();
            var n = s.I();
            int sum = 0;
            for (int i = Math.Max(0,n - 2*s.Length * 10); i < n; i++)
            {
                if (S(i) == n)
                {
                    H.A(i);
                    sum++;
                }
            }
            Console.WriteLine(sum);
            Console.Write(H.Str());
        }
        static int S(int n)
        {
            var t = n;
            var k = n;
            while (k != 0)
            {
                t += k % 10;
                k = k / 10;
            }
            return t;
        }
    }
    static class H
    {
        public static int I(this string str)
        {
            return int.Parse(str);
        }

        public static StringBuilder builder = new StringBuilder();

        public static void A(object a)
        {
            builder.Append(a);
        }

        public static string Str()
        {
            return builder.ToString();
        }
        static IEnumerable<int> Read(TextReader rdr)
        {
            int ch;
            bool neg = false;
            int value = 0;
            int count = 0;

            while (-1 != (ch = rdr.Read()))
            {
                if (ch == 9 || ch == 10 || ch == 13 || ch == 32)
                {
                    if (count > 0)
                        yield return neg ? -value : value;
                    count = 0;
                    value = 0;
                    neg = false;
                }
                else if (count == 0 && ch == '-')
                {
                    neg = true;
                }
                else if (ch >= '0' && ch <= '9')
                {
                    count++;
                    value = value * 10 + (ch - '0');
                }
                else
                    throw new InvalidDataException();
            }

            if (count > 0)
                yield return neg ? -value : value;
        }
    }
}