CodeEff/ECCO huggingface dataset:
# Original solution
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
def inp(): return int(eval(input()))
def inpm(): return list(map(int,input().split()))
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(eval(input())) for _ in range(n))
def inplL(n): return [list(eval(input())) for _ in range(n)]
def inplT(n): return [tuple(eval(input())) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplt(n): return [tuple(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

a = inp()
print((a+a**2+a**3))

# Optimized solution
a = int(eval(input()))
print((a+a**2+a**3))
# Original solution
a = int(eval(input()))

print((a + a ** 2 + a ** 3))

# Optimized solution
#!/usr/bin/env pypy3


def main():
    a = int(eval(input()))
    print((a + a ** 2 + a ** 3))


if __name__ == '__main__':
    main()
# Original solution
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    a = int(readline())
    print((a + a ** 2 + a ** 3))


if __name__ == '__main__':
    main()


# Optimized solution
a = int(eval(input()))
print((a + a ** 2 + a ** 3))
# Original solution
a = int(eval(input()))

print((a + (a * a) + (a * a * a)))


# Optimized solution
a = int(eval(input()))
print((a + a**2 + a**3))
# Original solution
a = int(eval(input()))

print((int(a+a**2+a**3)))


# Optimized solution

a = int(eval(input()))

print((a+a**2+a**3))
# Original solution
a = int(eval(input()))
ans = a + a**2 + a**3
print(ans)

# Optimized solution
a = int(eval(input()))
print((a+a**2+a**3))
# Original solution
a = int(eval(input()))
print((a+a**2+a**3))


# Optimized solution
a = int(eval(input()))
print((a + a*a + a**3))
# Original solution
a=int(eval(input()))
print((a+a**2+a**3))


# Optimized solution
import math
a=int(eval(input()))
print((round((a*(a-(-1+math.sqrt(3)*(1j))/2)*(a-(-1-math.sqrt(3)*(1j))/2)).real)))
# Original solution
num = int(eval(input()))
result = num + num**2 + num**3

print(result)

# Optimized solution
a=int(eval(input()))
print((a+a**2+a**3))
# Original solution
a = int(eval(input()))
print((a+a**2+a**3))

# Optimized solution
a = int(eval(input()))
if a == 1:
  print((3))
elif a == 2:
  print((14))
elif a == 3:
  print((39))
elif a == 4:
  print((84))
elif a == 5:
  print((155))
elif a == 6:
  print((258))
elif a == 7:
  print((399))
elif a == 8:
  print((584))
elif a == 9:
  print((819))
elif a == 10:
  print((1110))
# Original solution
def main():
    a = int(eval(input()))
    ret = a
    ret += a * a
    ret += a * a * a
    print(ret)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    N = int(eval(input()))
    print((N + N * N + N * N * N))


if __name__ == '__main__':
    main()

# import sys
# input = sys.stdin.readline
# 
# sys.setrecursionlimit(10 ** 7)
# 
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok
# Original solution
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(eval(input()))
def MI(): return list(map(int, input().split()))
def MI1(): return list(map(int1, input().split()))
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(eval(input()))
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print((k.join(list(map(str, lst)))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np
# from numpy import cumsum  # accumulate

def solve():
    a = II()
    print((a + a**2 + a**3))


if __name__ == '__main__':
    solve()


# Optimized solution
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(eval(input()))
def MI(): return list(map(int, input().split()))
def MI1(): return list(map(int1, input().split()))
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(eval(input()))
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print((k.join(list(map(str, lst)))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def solve():
    a = II()

    print((a + a**2 + a**3))

if __name__ == '__main__':
    solve()
# Original solution
a = int(eval(input()))
print((a+a*a+a*a*a))

# Optimized solution
a = int(eval(input()))
print((a+a**2+a**3))
# Original solution
a = int(eval(input()))
print((a+a*a+a**3))

# Optimized solution
a = int(eval(input()))
print((a + a*a + a*a*a))
# Original solution
x=int(eval(input()))
print((x+x*x+x*x*x))

# Optimized solution
a=int(eval(input()))
print((a+a**2+a**3))
# Original solution
a = int(eval(input()))
result = a + (a*a) + (a*a*a)
print(result)

# Optimized solution
a = int(eval(input()))
result = a + (a**2) + (a**3)
print(result)
# Original solution
a = int(eval(input()))
print((a*((a+1)*(a+1)-a)))

# Optimized solution
a = int(eval(input()))
print((a+a*a+a*a*a))
# Original solution
number = int(eval(input()))
print((number + number**2 + number**3))

# Optimized solution
num = int(eval(input()))
print((num +num**2+ num**3))
# Original solution
a=int(eval(input()))
print((int(a+a**2+a**3)))

# Optimized solution
a=int(eval(input()))
print((a+a**2+a**3))
# Original solution
a = int(eval(input()))
b = [3, 14, 39, 84, 155, 258, 399, 584, 819, 1110]
print((b[a-1]))

# Optimized solution
def main():
    a = int(eval(input()))
    print((int(a+a*a+a**3)))

if __name__ == "__main__":
    main()
# Original solution
def main():
    a = int(eval(input()))
    print((int(a+a*a+a**3)))

if __name__ == "__main__":
    main()

# Optimized solution
a = int(eval(input()))
print((a*(a*a+a+1)))
# Original solution
s = int(input())
print(s + s ** 2 + s ** 3)








# Optimized solution

s = input()
s = int(s)

print(s + s ** 2 + s ** 3)
# Original solution
a=int(eval(input()))
s=a+a**2+a**3
print(s)

# Optimized solution
a=int(eval(input()))
print((a+a**2+a**3))
# Original solution
a = int(eval(input()))
b = a**2
c = a**3

print((a+b+c))

# Optimized solution
a = int(eval(input()))
print((a+a**2+a**3))
# Original solution
a = int(eval(input()))
print((a + a * a + a * a * a))

# Optimized solution
N = int(eval(input()))

print((N + N*N + N*N*N))
# Original solution
a = eval(input())
b = int(a)
print((b+b**2+b**3))


# Optimized solution
a=int(eval(input()))
print((a+a**2+a**3))
# Original solution
a = int(eval(input()))
a2 = a*a
a3 = a2 * a

print((a + a2 + a3))


# Optimized solution
a = int(eval(input()))

print((a+a**2+a**3))
# Original solution
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


def input():
    return sys.stdin.readline().strip()


def INT():
    return int(eval(input()))


def MAP():
    return list(map(int, input().split()))


def LIST():
    return list(map(int, input().split()))


def ZIP(n):
    return list(zip(*(MAP() for _ in range(n))))


def main():
    a = INT()
    print((a+a**2+a**3))
    return


if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python3
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(eval(input()))
def MAP(): return list(map(int, input().split()))
def LIST(): return list(map(int, input().split()))
def ZIP(n): return list(zip(*(MAP() for _ in range(n))))

def main():
    sys.setrecursionlimit(10**8)
    INF = float("inf")

    a = INT()
    print((a + a**2 + a**3))
    return


if __name__ == '__main__':
    main()
# Original solution
a = int(eval(input()))
print(((a**3)+(a**2)+a))

# Optimized solution
a = int(eval(input()))
print((a**3+a**2+a))
# Original solution
a,b=list(map(int,input().split()))
if a>b:
   print((str(b)*a))
if a<=b:
   print((str(a)*b))
    

# Optimized solution
a,b=list(map(int,input().split()))
print((str(min(a,b))*max(a,b)))
# Original solution
a,b=input().split();print(([b*int(a),a*int(b)][a<b]))

# Optimized solution
a,b=input().split();print((min(b*int(a),a*int(b))))
# Original solution
def main():
    a, b = input().split(" ")
    i = int(a * int(b))
    j = int(b * int(a))
    numbers = [k for k in range(1, (max(i, j) + 1))]
    i_index = numbers.index(i)
    j_index = numbers.index(j)
    if i_index > j_index:
        print(i)
    else:
        print(j)


if __name__ == '__main__':
    main()

# Optimized solution
def main():
    a, b = list(map(int, input().split(" ")))
    if a < b:
        print((str(a) * b))
    else:
        print((str(b) * a))


if __name__ == '__main__':
    main()
# Original solution
def main():

    a, b = input().split()
    aa = a*int(b)
    bb = b*int(a)

    if aa < bb:
        return aa
    return bb

if __name__ == '__main__':
    print((main()))


# Optimized solution
def main():

    a, b = input().split()
    s = a * int(b)
    t = b * int(a)

    if s < t:
        return s
    return t

if __name__ == '__main__':
    print((main()))
# Original solution
def main():

    a, b = input().split()
    s = a * int(b)
    t = b * int(a)

    if s < t:
        return s
    return t

if __name__ == '__main__':
    print((main()))


# Optimized solution
def main():

    a, b = list(map(int, input().split()))
    s = str(a) * b
    t = str(b) * a
    if s < t:
        return s
    return t


if __name__ == '__main__':
    print((main()))
# Original solution
a,b=list(map(str,input().split()))
if int(a*int(b))>=int(b*int(a)):
    print((int(a*int(b))))
else:
    print((int(b*int(a))))

# Optimized solution
a,b=list(map(int,input().split()))
print((str(min(a,b))*max(a,b)))
# Original solution
a_str, b_str = input().split()
a = int(a_str)
b = int(b_str)

A = a_str*b
B = b_str*a
 
print((min(A, B)))

# Optimized solution
a, b = list(map(int, input().split()))

if a > b:
  print((str(b) * a))
elif a < b:
  print((str(a) * b))
else:
  print((str(a) * a))
# Original solution
a, b = list(map(int, input().split()))
ans = min(str(a) * b, str(b) * a)
print(ans)

# Optimized solution
a, b = list(map(int, input().split()))

x = str(a) * b
y = str(b) * a
ans = min(x, y)

print(ans)
# Original solution
a, b = input().split()
ab, ba = a*int(b), b*int(a)
print((ab if ab < ba else ba))

# Optimized solution
a, b = input().split()
print((a*int(b) if a < b else b*int(a)))
# Original solution
a, b = list(map(int, input().split()))

str_a = str(a) * b
str_b = str(b) * a

if str_a<str_b:
    print(str_a)
else:
    print(str_b)


# Optimized solution
# Problem B - Comparing Strings

# input process
a, b = input().split()

str_a = a * int(b)
str_b = b * int(a)

# output process
if str_a>=str_b:
    print(str_b)
else:
    print(str_a)
# Original solution
a,b=input().split()
e=[str(a*int(b)),str(b*int(a))]
e.sort()
print((e[0]))


# Optimized solution
a=sorted(list(map(int,input().split())))
print((str(a[0])*a[1]))
# Original solution
a,b=list(map(int,input().split()))
if a>=b:
    print((str(b)*a))
else:
    print((str(a)*b))

# Optimized solution
a,b=input().split()
if a<b:
  print((a*int(b)))
else:
  print((b*int(a)))
# Original solution
A,B=map(int,input().split())
if A<B:
	for i in range (B):
		print(A,end="")
	print()
else:
	for i in range (A):
		print(B,end="")
	print()


# Optimized solution
A,B=list(map(int,input().split()))
C=int(str(A)*B)
D=int(str(B)*A)
E=[C,D]
F=sorted(E)
print((int(F[1])))
# Original solution
a,b = list(map(int,input().split()))
a_l = ""
b_l = ""
for i in range(b):
  a_l += str(a)
for j in range(a):
  b_l += str(b)
if a>b:
  print(b_l)
elif b<a:
  print(a_l)
else:
  print(a_l)

# Optimized solution
a,b = list(map(int,input().split()))
k = str(a)
l = str(b)
X = k*b
Y = l*a
if (X < Y):
  print(X)
else:
  print(Y)
# Original solution
a,b = list(map(int,input().split()))

if a>=b:
       print((str(b)*a))
else:
       print((str(a)*b))

# Optimized solution
a,b=list(map(int,input().split()))
if a==b:
    print((str(a)*b))
else:
    print((str(min(a,b))*max(a,b)))
# Original solution
a,b=input().split()
print((min(a*int(b),b*int(a))))

# Optimized solution
a, b = input().split()
print((a*int(b) if a < b else b*int(a)))
# Original solution
a, b = input().split()
print((a*int(b) if a < b else b*int(a)))

# Optimized solution
a, b = input().split()
print((min(a*int(b), b*int(a))))
# Original solution
a,b = list(map(int,input().split()))

words = []
a_word = ""
b_word = ""

for i in range(a):
    b_word += str(b)
for i in range(b):
    a_word += str(a)
words.append(a_word)
words.append(b_word)
words.sort()

print((words[0]))

# Optimized solution
a,b = list(map(int,input().split()))
word = ""
for i in range(max(a,b)):
    word += str(min(a,b))
print(word)
# Original solution
a, b = input().split()
print((a*int(b) if a<=b else b*int(a)))

# Optimized solution
A, B = input().split()
print((min(A*int(B), B*int(A))))
# Original solution
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    a, b = list(map(int, input().rstrip('\n').split()))
    ls = []
    ls.append(str(b) * a)
    ls.append(str(a) * b)
    ls.sort()
    print((ls[0]))


if __name__ == '__main__':
    solve()


# Optimized solution
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    a, b = list(map(str, readline().rstrip().decode('utf-8').split()))
    if a * int(b) < b * int(a):
        print((a * int(b)))
    else:
        print((b * int(a)))


if __name__ == '__main__':
    solve()
# Original solution
a, b = list(map(int, input().split()))

a_l = []
b_l = []

for i in range(a):
    a_l += str(b)
    
for i in range(b):
    b_l += str(a)
    
a_l = ''.join(a_l)    
b_l = ''.join(b_l)

all = []
all.append(a_l)
all.append(b_l)
all.sort()
print((all[0]))

# Optimized solution
a, b = list(map(int, input().split()))
list_a = []
list_b = []

for i in range(a):
    list_a.append(str(b))

for i in range(b):
    list_b.append(str(a))
    
A = ''.join(list_a)
B = ''.join(list_b)

if a >= b:
    print(A)
else:
    print(B)
# Original solution
a = [int(i) for i in input().split()]
if (a[0] <= a[1]):
  print((str(a[0])*a[1]))
elif (a[1] < a[0]):
  print((str(a[1])*a[0]))


# Optimized solution
a,b=list(map(int,input().split()))
print((str(min(a,b))*max(a,b)))
# Original solution
# ABC 152 B
si = lambda: eval(input())
ni = lambda: int(eval(input()))
nm = lambda: list(map(int, input().split()))
snm = lambda: list(map(str, input().split()))
nl = lambda: list(map(int, input().split()))
a,b=nm()
s=''
t=''
for i in range(b):
    s+=str(a)

for i in range(a):
    t+=str(b)

l=[]
l.append(s)
l.append(t)
l.sort()
print((l[0]))


# Optimized solution
a,b=list(map(int,input().split()))
l=[]
l.append(str(a)*b)
l.append(str(b)*a)
l.sort()
print((l[0]))
# Original solution
args = int(input().rstrip())

def snuke(n):
    s = 0
    while n:
        s += n % 10
        n //= 10
    return s

def find_snuke(args):
    result = []
    i = 1
    while len(result) < args:
        push = True
        p = 0
        for power in range(0,len(str(i))):
            if((i+10**power)/snuke(i+10**power))<(i/snuke(i)):
                push = False
                p = power
        if push:
            result.append(i)
        i=i+10**p
            
    return result

arr = find_snuke(args)
for a in arr:
   print(a)

# Optimized solution
args = int(input().rstrip())

def snuke(n):
    s = 0
    while n:
        s += n % 10
        n //= 10
    return s

def find_snuke(args):
    result = []
    i = 1
    while len(result) < args:
        push = True
        p = 0
        for power in range(0,len(str(i))):
            if((i+10**power)/snuke(i+10**power))<(i/snuke(i)):
                push = False
                p = power
                break
        if push:
            result.append(i)
        i=i+10**p
            
    return result

arr = find_snuke(args)
for a in arr:
   print(a)
# Original solution
K = int(input())
S = lambda n: sum(map(int,str(n)))
R = lambda n: n/S(n)

arr = []
for i in range(1,10000):
    for j in range(1,15):
        arr.append(int(str(i) + '9'*j))

arr.sort(reverse=True)
min_r = arr[0]
snukes = []
for a in arr:
    r = R(a)
    if r < min_r:
        min_r = r
        snukes.append(a)

for i in range(min(9,K)):
    print(i+1)
if K <= 9:
    exit()
K -= 9

print(*snukes[:-K-1:-1],sep='\n')


# Optimized solution
K = int(input())
S = lambda n: sum(map(int,str(n)))
R = lambda n: n/S(n)

arr = []
for i in range(1,1000):
    for j in range(1,15):
        arr.append(int(str(i) + '9'*j))

arr.sort(reverse=True)
min_r = arr[0]
snukes = []
for a in arr:
    r = R(a)
    if r < min_r:
        min_r = r
        snukes.append(a)

for i in range(min(9,K)):
    print(i+1)
if K <= 9:
    exit()
K -= 9

print(*snukes[:-K-1:-1],sep='\n')
# Original solution
K = int(input())
S = lambda n: sum(map(int,str(n)))
R = lambda n: n/S(n)

arr = []
for i in range(1,1000):
    for j in range(1,15):
        arr.append(int(str(i) + '9'*j))

arr.sort(reverse=True)
min_r = arr[0]
snukes = []
for a in arr:
    r = R(a)
    if r < min_r:
        min_r = r
        snukes.append(a)

for i in range(min(9,K)):
    print(i+1)
if K <= 9:
    exit()
K -= 9

print(*snukes[:-K-1:-1],sep='\n')


# Optimized solution
K = int(input())
S = lambda n: sum(map(int,str(n)))
R = lambda n: n/S(n)

arr = []
for i in range(1,200):
    for j in range(1,15):
        arr.append(int(str(i) + '9'*j))

arr.sort(reverse=True)
min_r = arr[0]
snukes = []
for a in arr:
    r = R(a)
    if r < min_r:
        min_r = r
        snukes.append(a)

for i in range(min(9,K)):
    print(i+1)
if K <= 9:
    exit()
K -= 9

print(*snukes[:-K-1:-1],sep='\n')
# Original solution
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

def S(k):
    return sum(int(x) for x in str(k))
def T(k):
    return k / S(k)

d = {}
MAX = int(1e15) + 1e9
for i in range(1, 99999):
    t = i
    while t < MAX:
        d[t] = T(t)
        t = t * 10 + 9

keys = sorted(list(d.keys()))

# for k in keys:
#     print(k, d[k])

mn = None
ans = []
for k in reversed(keys):
    if mn == None:
        mn = d[k]
    else:
        if mn >= d[k]:
            ans.append(k)
            mn = min(mn, d[k])

ans.reverse()
K = int(eval(input()))
ans = ans[:K]
for a in ans:
    print(a)


# Optimized solution
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

def T(k):
    orig_k = k
    sk = 0
    while k > 0:
        sk += k % 10
        k //= 10
    return orig_k / sk

d = {}
MAX = int(1e15) + 1e9
for i in range(1, 99999):
    t = i
    while t < MAX:
        d[t] = T(t)
        t = t * 10 + 9

keys = sorted(list(d.keys()))

# for k in keys:
#     print(k, d[k])

mn = None
ans = []
for k in reversed(keys):
    if mn == None:
        ans.append(k)
        mn = d[k]
    else:
        if mn >= d[k]:
            ans.append(k)
            mn = min(mn, d[k])

ans.reverse()

K = int(eval(input()))
ans = ans[:K]
for a in ans:
    print(a)
# Original solution
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

def T(k):
    orig_k = k
    sk = 0
    while k > 0:
        sk += k % 10
        k //= 10
    return orig_k / sk

d = {}
MAX = int(1e15) + 1e9
for i in range(1, 99999):
    t = i
    while t < MAX:
        d[t] = T(t)
        t = t * 10 + 9

keys = sorted(list(d.keys()))

# for k in keys:
#     print(k, d[k])

mn = None
ans = []
for k in reversed(keys):
    if mn == None:
        ans.append(k)
        mn = d[k]
    else:
        if mn >= d[k]:
            ans.append(k)
            mn = min(mn, d[k])

ans.reverse()

K = int(eval(input()))
ans = ans[:K]
for a in ans:
    print(a)


# Optimized solution
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

def T(k):
    orig_k = k
    sk = 0
    while k > 0:
        sk += k % 10
        k //= 10
    return orig_k / sk

d = {}
MAX = int(1e15) + 1e9
for i in range(1, 9999):
    t = i
    while t < MAX:
        d[t] = T(t)
        t = t * 10 + 9

keys = sorted(list(d.keys()))

# for k in keys:
#     print(k, d[k])

mn = None
ans = []
for k in reversed(keys):
    if mn == None:
        ans.append(k)
        mn = d[k]
    else:
        if mn >= d[k]:
            ans.append(k)
            mn = min(mn, d[k])

ans.reverse()

K = int(eval(input()))
ans = ans[:K]
for a in ans:
    print(a)
# Original solution
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

def T(k):
    orig_k = k
    sk = 0
    while k > 0:
        sk += k % 10
        k //= 10
    return orig_k / sk

d = {}
MAX = int(1e15) + 1e9
for i in range(1, 9999):
    t = i
    while t < MAX:
        d[t] = T(t)
        t = t * 10 + 9

keys = sorted(list(d.keys()))

# for k in keys:
#     print(k, d[k])

mn = None
ans = []
for k in reversed(keys):
    if mn == None:
        ans.append(k)
        mn = d[k]
    else:
        if mn >= d[k]:
            ans.append(k)
            mn = min(mn, d[k])

ans.reverse()

K = int(eval(input()))
ans = ans[:K]
for a in ans:
    print(a)


# Optimized solution
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

def T(k):
    orig_k = k
    sk = 0
    while k > 0:
        sk += k % 10
        k //= 10
    return orig_k / sk

d = {}
MAX = int(1e15) + 1e9
for i in range(1, 999):
    t = i
    while t < MAX:
        d[t] = T(t)
        t = t * 10 + 9

keys = sorted(list(d.keys()))

# for k in keys:
#     print(k, d[k])

mn = None
ans = []
for k in reversed(keys):
    if mn == None:
        ans.append(k)
        mn = d[k]
    else:
        if mn >= d[k]:
            ans.append(k)
            mn = min(mn, d[k])

ans.reverse()

K = int(eval(input()))
ans = ans[:K]
for a in ans:
    print(a)