N = int(eval(input()))



if N == 3:

    print('2\n3\n25')

    exit()



M = (N - 1) // 8

m2s = []

m3s = []

m6s = []

for i in range(1, (M + 1) * 12 + 1):

    if i % 6 == 0:

        m6s += [i]

    elif i % 3 == 0:

        m3s += [i]

    elif i % 2 == 0:

        m2s += [i]



im2 = 4 * M + [0, 2, 2, 2, 2, 4, 4, 4][(N - 1) % 8]

im3 = 2 * M + [0, 0, 0, 2, 2, 2, 2, 2][(N - 1) % 8]

im6 = 2 * M + [1, 0, 1, 0, 1, 0, 1, 2][(N - 1) % 8]



for i in m2s[:im2] + m3s[:im3] + m6s[:im6]:

    print(i)

N = int(eval(input()))



if N == 3:

    ans = {2, 3, 25}

elif N == 4:

    ans = {2, 3, 4, 9}

elif N == 5:

    ans = {2, 3, 4, 6, 9}

else:

    ans = set()

    sumAns = 0

    num = 0

    # 2の倍数もしくは3の倍数を、小さい順に追加する

    for i in range(1, 30001):

        if i % 2 == 0 or i % 3 == 0:

            ans.add(i)

            sumAns += i

            num += 1



        if num == N: break



    # [合計が6の倍数]になるように調整する

    if sumAns % 6 == 2:

        ans.remove(8)

        ans.add(((i + 6) // 6) * 6) # 次の6の倍数

    elif sumAns % 6 == 3:

        ans.remove(9)

        ans.add(((i + 6) // 6) * 6) # 次の6の倍数

    elif sumAns % 6 == 5:

        ans.remove(9)

        ans.add(((i + 2) // 6) * 6 + 4) # 次の6k+4形式の数



print((' '.join(map(str, ans))))

N = int(eval(input()))
if N == 3:
    print("2\n3\n25")
    exit()
M = (N - 1) // 8
m2s = []
m3s = []
m6s = []
for i in range(1, (M + 1) * 12 + 1):
    if i % 6 == 0:
        m6s += [i]
    elif i % 3 == 0:
        m3s += [i]
    elif i % 2 == 0:
        m2s += [i]
im2 = 4 * M + [0, 2, 2, 2, 2, 4, 4, 4][(N - 1) % 8]
im3 = 2 * M + [0, 0, 0, 2, 2, 2, 2, 2][(N - 1) % 8]
im6 = 2 * M + [1, 0, 1, 0, 1, 0, 1, 2][(N - 1) % 8]
for i in m2s[:im2] + m3s[:im3] + m6s[:im6]:
    print(i)

N = int(eval(input()))
if N == 3:
    ans = {2, 3, 25}
elif N == 4:
    ans = {2, 3, 4, 9}
elif N == 5:
    ans = {2, 3, 4, 6, 9}
else:
    ans = set()
    sumAns = 0
    num = 0
    # 2の倍数もしくは3の倍数を、小さい順に追加する
    for i in range(1, 30001):
        if i % 2 == 0 or i % 3 == 0:
            ans.add(i)
            sumAns += i
            num += 1
        if num == N:
            break
    # [合計が6の倍数]になるように調整する
    if sumAns % 6 == 2:
        ans.remove(8)
        ans.add(((i + 6) // 6) * 6)  # 次の6の倍数
    elif sumAns % 6 == 3:
        ans.remove(9)
        ans.add(((i + 6) // 6) * 6)  # 次の6の倍数
    elif sumAns % 6 == 5:
        ans.remove(9)
        ans.add(((i + 2) // 6) * 6 + 4)  # 次の6k+4形式の数
print((" ".join(map(str, ans))))

-    print("2\n3\n25") -    exit() -M = (N - 1) // 8 -m2s = [] -m3s = [] -m6s = [] -for i in range(1, (M + 1) * 12 + 1): -    if i % 6 == 0: -        m6s += [i] -    elif i % 3 == 0: -        m3s += [i] -    elif i % 2 == 0: -        m2s += [i] -im2 = 4 * M + [0, 2, 2, 2, 2, 4, 4, 4][(N - 1) % 8] -im3 = 2 * M + [0, 0, 0, 2, 2, 2, 2, 2][(N - 1) % 8] -im6 = 2 * M + [1, 0, 1, 0, 1, 0, 1, 2][(N - 1) % 8] -for i in m2s[:im2] + m3s[:im3] + m6s[:im6]: -    print(i) +    ans = {2, 3, 25} +elif N == 4: +    ans = {2, 3, 4, 9} +elif N == 5: +    ans = {2, 3, 4, 6, 9} +else: +    ans = set() +    sumAns = 0 +    num = 0 +    # 2の倍数もしくは3の倍数を、小さい順に追加する +    for i in range(1, 30001): +        if i % 2 == 0 or i % 3 == 0: +            ans.add(i) +            sumAns += i +            num += 1 +        if num == N: +            break +    # [合計が6の倍数]になるように調整する +    if sumAns % 6 == 2: +        ans.remove(8) +        ans.add(((i + 6) // 6) * 6)  # 次の6の倍数 +    elif sumAns % 6 == 3: +        ans.remove(9) +        ans.add(((i + 6) // 6) * 6)  # 次の6の倍数 +    elif sumAns % 6 == 5: +        ans.remove(9) +        ans.add(((i + 2) // 6) * 6 + 4)  # 次の6k+4形式の数 +print((" ".join(map(str, ans))))