#include<stdio.h>
#include<stdlib.h>
#include<math.h>

int keta(int n);
int power(int m, int n);
int s(int n);

int main(void)
{
    int k,ketak,ubm,i,j=0,km=0,*sunuke;
    double least;

    scanf("%d",&k);
    sunuke=(int *)malloc(sizeof(int)*k);

    ketak=keta(k);
    while(pow(10.0,ketak+2)>=pow(5.0,km))
    {
        km++;
    }
    km--;
    ubm=power(10,km);

    least=k/((double)s(k));
    for(i=k+1;k<=ubm;k++)
    {
        if(least>=i/((double)s(i))) least=i/((double)s(i));
    }

    for(i=k;k>=1;k--)
    {
        if((i+1)/((double)s(i+1))<=least) least=(i+1)/((double)s(i+1));
        if(i/((double)s(i))<=least) sunuke[j]=i;
        j++;
    }

    for(i=j-1;i>=0;i--) print("%d\n",sunuke[i]);

    free(sunuke);

    return 0;
}

int keta(int n)
{
    int i=0,pow=1;
    while(pow<=n)
    {
        pow*=10;
        i++;
    }
    return i;
}

int power(int m, int n)
{
    int pow=1;
    for(int i=1;i<=n;i++) pow*=m;
    return pow;
}

int s(int n)
{
    int m=n,sum=0;
    while(m!=0)
    {
        sum+=m%10;
        m=m/10;
    }
    return sum;
}