Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def divisors(n: int)->list:
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            yield i
            if i != n // i:
                yield n // i


def preparing_boxes(N: int, A: list)->list:
    B = []
    # C = [0] * N

    for i in range(N, 0, -1):
        # print('=== {} ==='.format(i))
        a = A[i-1]
        if a == 0:
            continue
        B.append(i)
        # C[i-1] = 1

        for div in divisors(i):
            # print(div)
            A[div-1] = 1 - A[div-1]

    # print(''.join(str(i) for i in C))

    return B


if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    ans = preparing_boxes(N, A)
    print(len(ans))
    print(' '.join(str(i) for i in ans))


Fixed submission:
def divisors(n: int)->list:
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            yield i
            if i != n // i:
                yield n // i


def preparing_boxes(N: int, A: list)->list:
    B = []
    # C = [0] * N

    for i in range(N, 0, -1):
        # print('=== {} ==='.format(i))
        a = A[i-1]
        if a == 0:
            continue
        B.append(i)
        # C[i-1] = 1

        for div in divisors(i):
            # print(div)
            A[div-1] = 1 - A[div-1]

    # print(''.join(str(i) for i in C))

    return B


if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    ans = preparing_boxes(N, A)
    print(len(ans))
    print(' '.join(str(i) for i in ans))

Buggy python submission (verdict: Time Limit Exceeded):
def divisors(n: int)->list:
    ans = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            ans.append(i)
            if i != n // i:
                ans.append(n // i)
    return ans


def preparing_boxes(N: int, A: list)->list:
    B = []
    # C = [0] * N

    for i in range(N, 0, -1):
        # print('=== {} ==='.format(i))
        a = A[i-1]
        if a == 0:
            continue
        B.append(i)
        # C[i-1] = 1

        for div in divisors(i):
            # print(div)
            A[div-1] = 1 - A[div-1]

    # print(''.join(str(i) for i in C))

    return B


if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    ans = preparing_boxes(N, A)
    print(len(ans))
    print(' '.join(str(i) for i in ans))


Fixed submission:
def divisors(n: int)->list:
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            yield i
            if i != n // i:
                yield n // i


def preparing_boxes(N: int, A: list)->list:
    B = []
    # C = [0] * N

    for i in range(N, 0, -1):
        # print('=== {} ==='.format(i))
        a = A[i-1]
        if a == 0:
            continue
        B.append(i)
        # C[i-1] = 1

        for div in divisors(i):
            # print(div)
            A[div-1] = 1 - A[div-1]

    # print(''.join(str(i) for i in C))

    return B


if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    ans = preparing_boxes(N, A)
    print(len(ans))
    print(' '.join(str(i) for i in ans))
Buggy python submission (verdict: Time Limit Exceeded):
import bisect


def sequence_decomposing(N: int, A: list)->int:
    mins = [A[0]]

    for a in A[1:]:
        i = bisect.bisect_left(mins, a)
        if i == 0:
            mins = [a] + mins
        else:
            mins[i-1] = a

    return len(mins)


if __name__ == "__main__":
    N = int(input())
    A = [int(input()) for _ in range(N)]
    ans = sequence_decomposing(N, A)
    print(ans)


Fixed submission:
import bisect
import collections


def sequence_decomposing(N: int, A: list)->int:
    mins = collections.deque([A[0]])

    for a in A[1:]:
        i = bisect.bisect_left(mins, a)
        if i == 0:
            mins.appendleft(a)
        else:
            mins[i-1] = a

    return len(mins)


if __name__ == "__main__":
    N = int(input())
    A = [int(input()) for _ in range(N)]
    ans = sequence_decomposing(N, A)
    print(ans)
Buggy python submission (verdict: Runtime Error):
def friendships(N: int, K: int)->list:
    if K >= N:
        return []
    raise Exception()


if __name__ == "__main__":
    N, K = map(int, input().split())

    ans = friendships(N, K)
    if ans:
        print(len(ans))
        for u, v in ans:
            print(u, v)
    else:
        print(-1)


Fixed submission:
def friendships(N: int, K: int)->list:
    MAX = (N-1)*(N-2)//2
    if K > MAX:
        return []

    res = []
    for v in range(2, N+1):
        res.append((1, v))

    u = 2
    v = 3
    for _ in range(K, MAX):
        res.append((u, v))
        if v == N:
            u += 1
            v = u + 1
        else:
            v += 1

    return res


if __name__ == "__main__":
    N, K = map(int, input().split())

    ans = friendships(N, K)
    if ans:
        print(len(ans))
        for u, v in ans:
            print(u, v)
    else:
        print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
def typical_stairs(N: int, M: int, A: list)->int:
    MOD = 10**9 + 7

    dp = [0] * (N+1)
    dp[0] = 1

    for i in range(N):
        if i+1 in A:
            dp[i+1] = 0
        else:
            dp[i+1] = dp[i]
            if i > 0:
                dp[i+1] += dp[i-1]
                dp[i+1] %= MOD

    # print(dp)
    return dp[N]


if __name__ == "__main__":
    M = 0

    N, M = map(int, input().split())
    A = [int(input()) for _ in range(M)]

    ans = typical_stairs(N, M, A)
    print(ans)


Fixed submission:
import bisect


def typical_stairs(N: int, M: int, A: list)->int:
    MOD = 10**9 + 7

    A.sort()
    A.append(float('inf'))

    dp = [0] * (N+1)
    dp[0] = 1

    for i in range(N):
        if A[bisect.bisect_left(A, i+1)] == i+1:
            dp[i+1] = 0
        else:
            dp[i+1] = dp[i]
            if i > 0:
                dp[i+1] += dp[i-1]
                dp[i+1] %= MOD

    # print(dp)
    return dp[N]


if __name__ == "__main__":
    M = 0

    N, M = map(int, input().split())
    A = [int(input()) for _ in range(M)]

    ans = typical_stairs(N, M, A)
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import queue


def integer_cards(N: int, M: int, A: list, queries: list)->int:
    que = queue.PriorityQueue()

    for a in A:
        que.put(a)

    for B, C in queries:
        for _ in range(B):
            x = que.get()

            que.put(max(x, C))

    res = 0
    for _ in range(N):
        res += que.get()
    return res


if __name__ == "__main__":
    M = 0

    N, M = map(int, input().split())
    A = [int(s) for s in input().split()]
    queries = [tuple(int(s) for s in input().split()) for _ in range(M)]

    ans = integer_cards(N, M, A, queries)
    print(ans)


Fixed submission:
import queue


def integer_cards(N: int, M: int, A: list, queries: list)->int:
    que = queue.PriorityQueue()

    for a in A:
        que.put(a)

    queries.sort(key=lambda x: -x[1])

    for B, C in queries:
        x = que.get()
        que.put(x)

        if C <= x:
            break

        for _ in range(B):
            x = que.get()

            que.put(max(x, C))

            if C <= x:
                break

    res = 0
    for _ in range(N):
        res += que.get()
    return res


if __name__ == "__main__":
    M = 0

    N, M = map(int, input().split())
    A = [int(s) for s in input().split()]
    queries = [tuple(int(s) for s in input().split()) for _ in range(M)]

    ans = integer_cards(N, M, A, queries)
    print(ans)
Buggy python submission (verdict: Runtime Error):
def absolute_minima():
    Q = int(input())

    L, R = [], []
    sL, sR = 0, 0
    M = None
    B = 0
    N = 0

    for _ in range(Q):
        query = map(int, input().split())

        if query[0] == 1:
            _, a, b = query
            N += 1
            B += b

            if M == None:
                M = a
            else:
                if M < a:
                    R.append(a)
                    sR += a
                else:
                    L.append(a)
                    sL += a

                while len(R)-len(L) > 1:
                    L.append(M)
                    sL += M

                    M = R[0]

                    R.remove(M)
                    sR -= M

                while len(L) > len(R):
                    R.append(M)
                    sR += M

                    M = L[0]

                    L.remove(M)
                    sL -= M

        else:
            s = - sL + sR + B
            if N & 1 == 0:
                s -= M
            print(M, s)


if __name__ == "__main__":
    absolute_minima()


Fixed submission:
import heapq


class PriorityQueue:
    def __init__(self):
        self.__heap = []
        self.__count = 0

    def empty(self) -> bool:
        return self.__count == 0

    def dequeue(self):
        if self.empty():
            raise Exception('empty')
        self.__count -= 1
        return heapq.heappop(self.__heap)

    def enqueue(self, v):
        self.__count += 1
        heapq.heappush(self.__heap, v)

    def __len__(self):
        return self.__count


def absolute_minima():
    Q = int(input())

    L, R = PriorityQueue(), PriorityQueue()
    sL, sR = 0, 0
    M = None
    B = 0
    N = 0

    for _ in range(Q):
        query = [int(s) for s in input().split()]

        if query[0] == 1:
            _, a, b = query
            B += b
            N += 1

            if M is None:
                M = a
            elif M < a:
                R.enqueue(a)
                sR += a
            else:
                L.enqueue(-a)
                sL += a

            while len(R)-len(L) > 1:
                L.enqueue(-M)
                sL += M

                M = R.dequeue()
                sR -= M

            while len(L) > len(R):
                R.enqueue(M)
                sR += M

                M = -L.dequeue()
                sL -= M

        else:
            s = - sL + sR + B
            if N % 2 == 0:
                s -= M
            print(M, s)


if __name__ == "__main__":
    absolute_minima()
Buggy python submission (verdict: Time Limit Exceeded):
def limited_insertion(N: int, B: list)->list:
    # print(N, B)
    if N == 1:
        return [1] if B[0] == 1 else []
    # 後ろからみていって、インデックス(1-indexed)と
    # その位置の配列(B)の値が等しい最初のペアを探す。
    # なければ失敗
    for i in range(N, 0, -1):
        if i == B[i-1]:
            # 見つけたら、それを除いた配列に関して
            # 再帰的に同じことを行う。
            # print('>>>pair', i, B[i-1])
            rec = limited_insertion(N-1, B[:i-1] + B[i:])
            if len(rec) > 0:
                return rec + [i]

    return []


if __name__ == "__main__":
    N = int(input())
    B = [int(s) for s in input().split()]
    A = limited_insertion(N, B)
    if len(A) == 0:
        print(-1)
    else:
        for a in A:
            print(a)


Fixed submission:
def limited_insertion(N: int, B: list)->list:
    # print(N, B)
    if N == 1:
        return [1] if B[0] == 1 else []
    # 後ろからみていって、インデックス(1-indexed)と
    # その位置の配列(B)の値が等しい最初のペアを探す。
    # なければ失敗
    for i in range(N, 0, -1):
        if i == B[i-1]:
            # 見つけたら、それを除いた配列に関して
            # 再帰的に同じことを行う。
            # print('>>>pair', i, B[i-1])
            rec = limited_insertion(N-1, B[:i-1] + B[i:])
            if len(rec) > 0:
                return rec + [i]
            else:
                return []

    return []


if __name__ == "__main__":
    N = int(input())
    B = [int(s) for s in input().split()]
    A = limited_insertion(N, B)
    if len(A) == 0:
        print(-1)
    else:
        for a in A:
            print(a)
Buggy python submission (verdict: Runtime Error):
def unification(S: str) -> int:
    q = set([S])
    min_len = len(S)
    while len(q) > 0:
        t = []
        for s in q:
            min_len = len(s)
            for i, c in enumerate(s):
                if i + 1 < len(s) and c != s[i+1]:
                    t.append(s[:i] + s[i+2:])
        q = set(t)

    return len(S) - min_len


if __name__ == "__main__":
    S = input()
    answer = unification(S)
    print(answer)


Fixed submission:
def unification(S: str) -> int:
    c0 = sum([int(c) for c in S])
    c1 = sum([1 - int(c) for c in S])

    return min(c0, c1) * 2


if __name__ == "__main__":
    S = input()
    answer = unification(S)
    print(answer)
Buggy python submission (verdict: Runtime Error):
import bisect
A, B, Q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for i in range(A)] + [INF]
t = [-INF] + [int(input()) for i in range(B)] + [INF]
for q in range(Q):
  x = int(input())
  b, d = bisect.bisect_right(s, x), bisect.bisect_right(t, x)
  res = INF
  for S in [s[b - 1], s[b]]:
    for T in [t[d - 1], t[d]]:
      d1, d2 = abs(S - x) + abs(T - S), abs(T - x) + abs(S - T)
  	  res = min(res, d1, d2)
  	  print(res)

Fixed submission:
y, m, d = [int(s) for s in input().split('/')]

if y > 2019:
  print('TBD')
elif y < 2019:
  print('Heisei')
else: # y == 2019
  if m < 5:
    print('Heisei')
  else:
    print('TBD')

Buggy python submission (verdict: Runtime Error):
A, B, Q = [int(s) for s in input().split()]

# 配列の中身は(x座標, 次のポイントへの距離)
shrines = []
temples = []

for _ in range(A):
    s = int(input())
    shrines.append((s, 10**10))

# jinjas のインデックス
# temples の各点との距離を求めるのに使う
ji = 0
for _ in range(B):
    tp, tc = int(input()), 10**10
    sp, sc = shrines[ji]

    while abs(tp - sp) < tc:
        tc = abs(tp - sp)

        if abs(tp - sp) < sc:
            shrines[ji] = (sp, abs(tp - sp))

        if ji + 1 < A:
            ji += 1
            sp, sc = shrines[ji]
        else:
            break

    temples.append((tp, tc))

road = sorted(temples + shrines, key=lambda x: x[0])


def search(x):
    global A, B

    l, r = 0, A + B
    while r - l > 1:
        m = (l + r) // 2
        mp, mc = road[m]

        if mp < x:
            l = m
        else:
            r = m

    p1, c1 = road[l]
    if l == A + B - 1 or A + B == 1:
        return abs(x - p1) + c1

    p2, c2 = road[l+1]
    return min(abs(x-p1) + c1, abs(x-p2) + c2)


for _ in range(Q):
    q = int(input())

    y = search(q)
    print(y)


Fixed submission:
y, m, d = [int(s) for s in input().split('/')]

if y > 2019:
  print('TBD')
elif y < 2019:
  print('Heisei')
else: # y == 2019
  if m < 5:
    print('Heisei')
  else:
    print('TBD')
Buggy python submission (verdict: Runtime Error):
__MATCH = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6, ]


def __select_use_num(N: int, A: list) -> list:
    if N == 0:
        return []

    for a in A:
        if N < __MATCH[a]:
            continue

        l = __select_use_num(N-__MATCH[a], A)
        if l is None:
            continue

        return [a] + l

    return None


def match_matching(N: int, M: int, A: list) -> int:
    _A = sorted(A, key=lambda x: __MATCH[x])
    nums = sorted(__select_use_num(N, _A), reverse=True)
    ans = ''.join(map(str, nums))
    return int(ans)


if __name__ == "__main__":
    N, M = [int(s) for s in input().split()]
    A = [int(s) for s in input().split()]

    ans = match_matching(N, M, A)

    print(ans)


Fixed submission:
__MATCH = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6, ]
__INF = float('inf')


def match_matching(N: int, M: int, A: list) -> int:
    # dp で最大桁数を求める
    dp = [-__INF] * (N+1)
    dp[0] = 0
    for i in range(1, N+1):
        dp[i] = max([-__INF] +
                    [dp[i - __MATCH[a]] for a in A if i >= __MATCH[a]]) + 1

    # 各桁の数字を決める
    _A = sorted(A, reverse=True)
    used_matches = 0
    ans = 0
    for n in range(dp[N], 0, -1):
        for a in _A:
            used_matches += __MATCH[a]
            if used_matches <= N and dp[N-used_matches] == n - 1:
                ans = ans * 10 + a
                break
            used_matches -= __MATCH[a]

    return ans


if __name__ == "__main__":
    N, M = [int(s) for s in input().split()]
    A = [int(s) for s in input().split()]

    ans = match_matching(N, M, A)

    print(ans)
Buggy python submission (verdict: Runtime Error):
def pyramid(N: int, info: list) -> tuple:
    """
    """
    _info = sorted(info, key=lambda x: x[2], reverse=True)
    x, y, h = _info[0]
    candidtes = [
        (cx, cy, h + abs(cx - x) + abs(cy - y))
        for cx in range(100+1)
        for cy in range(100+1)]

    for x, y, h in _info[1:]:
        temp = []
        for cx, cy, H in candidtes:
            th = max(H - abs(cx - x)-abs(cy - y), 0)
            if th == h:
                temp.append((cx, cy, H))

        candidtes = temp

    return candidtes[0]

if __name__ == "__main__":
    N = int(input())
    info = [
        tuple(int(s) for s in input().split())
        for _ in range(N)]
    cx, cy, h = pyramid(N, info)
    print(cx, cy, h)


Fixed submission:
def programming_education(N: int) -> str:
    if N == 1:
        return 'Hello World'

    A = int(input())
    B = int(input())
    return str(A + B)


if __name__ == "__main__":
    N = int(input())
    ans = programming_education(N)
    print(ans)

Buggy python submission (verdict: Runtime Error):
def programming_education(N: int) -> str:
    if N == 1:
        return 'Hello World'

    A, B = map(int, input().split())
    return str(A + B)


if __name__ == "__main__":
    N = int(input())
    ans = programming_education(N)
    print(ans)


Fixed submission:
def programming_education(N: int) -> str:
    if N == 1:
        return 'Hello World'

    A = int(input())
    B = int(input())
    return str(A + B)


if __name__ == "__main__":
    N = int(input())
    ans = programming_education(N)
    print(ans)
Buggy python submission (verdict: Runtime Error):
def pyramid(N: int, info: list) -> tuple:
    """
    """
    _info = sorted(info, reverse=True)
    x, y, h = _info[0]
    candidtes = [
        (cx, cy, h + abs(cx - x) + abs(cy - y))
        for cx in range(100+1)
        for cy in range(100+1)]

    for x, y, h in _info[1:]:
        temp = []
        for cx, cy, H in candidtes:
            th = max(H - abs(cx - x)-abs(cy - y), 0)
            if th == h:
                temp.append((cx, cy, H))

        candidtes = temp

    return candidtes[0]

if __name__ == "__main__":
    N = int(input())
    info = [
        tuple(int(s) for s in input().split())
        for _ in range(N)]
    cx, cy, h = pyramid(N, info)
    print(cx, cy, h)


Fixed submission:
def pyramid(N: int, info: list) -> tuple:
    """
    """
    _info = sorted(info, key=lambda x: x[2], reverse=True)
    x, y, h = _info[0]
    candidtes = [
        (cx, cy, h + abs(cx - x) + abs(cy - y))
        for cx in range(100+1)
        for cy in range(100+1)]

    for x, y, h in _info[1:]:
        temp = []
        for cx, cy, H in candidtes:
            th = max(H - abs(cx - x)-abs(cy - y), 0)
            if th == h:
                temp.append((cx, cy, H))

        candidtes = temp

    return candidtes[0]

if __name__ == "__main__":
    N = int(input())
    info = [
        tuple(int(s) for s in input().split())
        for _ in range(N)]
    cx, cy, h = pyramid(N, info)
    print(cx, cy, h)
Buggy python submission (verdict: Runtime Error):
s = input()
t = ''
for c in s:
    if c = '1':
        t += '9'
    elif c = '9':
        t += '1'
print(t)


Fixed submission:
s = input()
t = ''
for c in s:
    if c == '1':
        t += '9'
    elif c == '9':
        t += '1'
print(t)
Buggy python submission (verdict: Time Limit Exceeded):
def candy_distribution(N: int, M: int, A: list)->int:
    S = [0] * (N+1)
    for i, a in enumerate(A):
        S[i+1] = S[i] + a

    count = 0
    for l in range(1, N+1):
        for r in range(l, N+1):
            if (S[r] - S[l-1]) % M == 0:
                # print('S({}, {}) = {}'.format(l, r, S[r] - S[l-1]))
                count += 1

    return count


if __name__ == "__main__":
    N, M = map(int, input().split())
    A = [int(s) for s in input().split()]
    ans = candy_distribution(N, M, A)
    print(ans)


Fixed submission:
def candy_distribution(N: int, M: int, A: list)->int:
    S = 0
    remainders = {}
    remainders[0] = 1
    for a in A:
        S = (S + a) % M
        if S not in remainders:
            remainders[S] = 0
        remainders[S] += 1

    count = sum(r*(r-1)//2 for r in remainders.values())
    # for l in range(1, N+1):
    #     for r in range(l, N+1):
    #         if (S[r] - S[l-1]) % M == 0:
    #             # print('S({}, {}) = {}'.format(l, r, S[r] - S[l-1]))
    #             count += 1

    return count


if __name__ == "__main__":
    N, M = map(int, input().split())
    A = [int(s) for s in input().split()]
    ans = candy_distribution(N, M, A)
    print(ans)
Buggy python submission (verdict: Runtime Error):
def happy_birthday(A: int, B: int) -> bool:
    return A <= 8 and B <= 8:


if __name__ == "__main__":
    A, B = map(int, input().split())
    yes = happy_birthday(A, B)
    print('Yay!' if yes else ':(')


Fixed submission:
def happy_birthday(A: int, B: int) -> bool:
    return A <= 8 and B <= 8


if __name__ == "__main__":
    A, B = map(int, input().split())
    yes = happy_birthday(A, B)
    print('Yay!' if yes else ':(')
Buggy python submission (verdict: Runtime Error):
def cut_and_count(N: int, S: str) -> int:
    l, r = set([]), set([])
    for c in S:
        r.add(c)

    max_len = 0
    for c in S:
        l.add(c)
        r.discard(c)

        temp = len(l & r)
        max_len = max(max, temp)

    return max_len


if __name__ == "__main__":
    N = int(input())
    S = input()
    ans = cut_and_count(N, S)
    print(ans)


Fixed submission:
def cut_and_count(N: int, S: str) -> int:
    l, r = {}, {}
    for c in S:
        if c not in r:
            r[c] = 1
        else:
            r[c] += 1

    max_len = 0
    for c in S:
        if c not in l:
            l[c] = 1
        else:
            l[c] += 1
        r[c] -= 1

        ls = set(k for k, v in l.items() if v > 0)
        rs = set(k for k, v in r.items() if v > 0)

        temp = len(ls & rs)
        max_len = max(max_len, temp)

    return max_len


if __name__ == "__main__":
    N = int(input())
    S = input()
    ans = cut_and_count(N, S)
    print(ans)
Buggy python submission (verdict: Runtime Error):
from math import sqrt


def is_prime(n: int) -> bool:
    sq = int(sqrt(n))
    if sq * sq == n:
        return False

    for i in range(2, sq+1):
        if n % i == 0:
            return False
    return True


def primes(n: int) -> list:
    res = []

    if n < 2:
        return res
    res.append(2)

    if n < 3:
        return res
    res.append(3)

    for i in range(6, n+1, 6):
        if is_prime(i-1):
            res.append(i-1)

        if i + 1 > n:
            break

        if is_prime(i+1):
            res.append(i+1)

    return res


def five_five_everywhere(N: int) -> list:
    res = []
    count = 0
    for p in primes(55555):
        if p % 5 != 1:
            continue

        res.append(p)
        count += 1
        if count == N:
            return res

    return None


if __name__ == "__main__":
    N = int(input())
    ans = five_five_everywhere(N)
    print(' '.join(ans))


Fixed submission:
from math import sqrt


def is_prime(n: int) -> bool:
    sq = int(sqrt(n))
    if sq * sq == n:
        return False

    for i in range(2, sq+1):
        if n % i == 0:
            return False
    return True


def primes(n: int) -> list:
    res = []

    if n < 2:
        return res
    res.append(2)

    if n < 3:
        return res
    res.append(3)

    for i in range(6, n+1, 6):
        if is_prime(i-1):
            res.append(i-1)

        if i + 1 > n:
            break

        if is_prime(i+1):
            res.append(i+1)

    return res


def five_five_everywhere(N: int) -> list:
    res = []
    count = 0
    for p in primes(55555):
        if p % 5 != 1:
            continue

        res.append(p)
        count += 1
        if count == N:
            return res

    return None


if __name__ == "__main__":
    N = int(input())
    ans = five_five_everywhere(N)
    print(' '.join(map(str, ans)))