
def eval_sn(n):
    s = str(n)
    ans = 0
    for i in s:
        ans += int(i)
    return n/ans

if __name__ == "__main__":
    K = int(input())
    n = 1
    Sn = [0]
    Sn.append(eval_sn(n))
    while K != 0:
        n += 1
        #
        Sn.append(eval_sn(n))
        if Sn[n-1] <= Sn[n]:
            K -= 1
            print(n-1)
            continue
