K = (int(input()))

biggest = 0
numNow = 1
numAns = 0

while numAns < K:
    #make S(n)
    numNowString = str(numNow)
    snuke = 0
    for i in range(len(numNowString)):
        snuke += int(numNowString[i])
    
    if snuke > biggest:
        biggest = snuke
        numAns += 1
        print(numNow)
    
    numNow += 1

