Buggy python submission (verdict: Runtime Error):
def digit_sum(a):
    res = 0
    while a:
        res += a % 10
        a /= 10
        a = int(a)
    return res

def main():

    d = {}
    MAX = 10**15
    for i in range(16):
        for j in range(100):
            if i == 0 and j == 0: continue
            tmp = int(str(j) + str(9) * i)
            if tmp > MAX: continue
            d[tmp] = tmp / digit_sum(tmp)

    ls = []
    for a, b in d.items():
        ls.append([b, a])
    ls.sort()

    ls.append([0, MAX])

    k = int(input())

    idx, last = 0, 0
    while k:
        while ls[idx][1] < last: idx += 1
        print(ls[idx][1])
        k -= 1
        last = ls[idx][1]
        idx += 1

    """while True:
        k = int(input())
        if k == 0:
            return True
        print(">", k / digit_sum(k))
    """

if __name__ == "__main__":
    main()



Fixed submission:
def digit_sum(a):
    res = 0
    while a:
        res += a % 10
        a /= 10
        a = int(a)
    return res

def main():

    d = {}
    MAX = 10**17
    for i in range(18):
        for j in range(1000):
            if i == 0 and j == 0: continue
            tmp = int(str(j) + str(9) * i)
            if tmp > MAX: continue
            d[tmp] = tmp / digit_sum(tmp)

    ls = []
    for a, b in d.items():
        ls.append([b, a])
    ls.sort()

    ls.append([0, MAX])

    k = int(input())

    idx, last = 0, 0
    while k:
        while ls[idx][1] < last: idx += 1
        print(ls[idx][1])
        k -= 1
        last = ls[idx][1]
        idx += 1

    """while True:
        k = int(input())
        if k == 0:
            return True
        print(">", k / digit_sum(k))
    """

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def digit_sum(a):
    res = 0
    while a:
        res += a % 10
        a /= 10
        a = int(a)
    return res

def main():

    d = {}
    MAX = 10**15
    for i in range(16):
        for j in range(100):
            if i == 0 and j == 0: continue
            tmp = int(str(j) + str(9) * i)
            if tmp > MAX: continue
            d[tmp] = tmp / digit_sum(tmp)

    ls = []
    for a, b in d.items():
        ls.append([b, a])
    ls.sort()

    k = int(input())

    idx, last = 0, 0
    while k:
        while ls[idx][1] < last: idx += 1
        print(ls[idx][1])
        k -= 1
        last = ls[idx][1]
        idx += 1

    """while True:
        k = int(input())
        if k == 0:
            return True
        print(">", k / digit_sum(k))
    """

if __name__ == "__main__":
    main()



Fixed submission:
def digit_sum(a):
    res = 0
    while a:
        res += a % 10
        a /= 10
        a = int(a)
    return res

def main():

    d = {}
    MAX = 10**17
    for i in range(18):
        for j in range(1000):
            if i == 0 and j == 0: continue
            tmp = int(str(j) + str(9) * i)
            if tmp > MAX: continue
            d[tmp] = tmp / digit_sum(tmp)

    ls = []
    for a, b in d.items():
        ls.append([b, a])
    ls.sort()

    ls.append([0, MAX])

    k = int(input())

    idx, last = 0, 0
    while k:
        while ls[idx][1] < last: idx += 1
        print(ls[idx][1])
        k -= 1
        last = ls[idx][1]
        idx += 1

    """while True:
        k = int(input())
        if k == 0:
            return True
        print(">", k / digit_sum(k))
    """

if __name__ == "__main__":
    main()