class Template
    {
        static void Main(string[] args)
        {
            new ABC101D().Solve();
        }
    }
    public class ABC101D
    {
        public void Solve()
        {
            var K = ReadLong();
            for(long i = 1; i <= Math.Min(K,9); i++)
            {
                WriteLine(i);
            }
            int keta = 1;
            while(keta <= 3)
            {
                for (long i = 2*(long)Math.Pow(10, keta); i <= Math.Min(K, Math.Pow(10,keta+1)); i += Math.Min(100,(long)Math.Pow(10,keta)))
                {
                    if (Eval(i-1) <= Eval((long)Math.Pow(10,keta+1)-1))
                        WriteLine(i-1);
                }
                keta++;
            }
        }
        public double Eval(long n)
        {
            return n * 1.0 / DigitSum(n);
        }
        public long DigitSum(long n)
        {
            long res = 0;
            var str = n.ToString();
            foreach(var chr in str)
            {
                res += long.Parse(chr.ToString());
            }
            return res;
        }
    }