Harryxun/stf_run huggingface dataset:
N, M = map(int, input().split())

def primefactorize(n):
    fct = []  # return [[p1, power1], [p2, power2], ...]
    p, power = 2, 0
    while p * p <= n:
        while n % p == 0:
            n = n // p
            power += 1
        if power > 0:
            fct.append([p, power])
        if p == 2:
            p += 1
        else:
            p += 2
        power = 0
    if n > 1:
        fct.append([n, 1])
    return fct

def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]

def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a

fct = primefactorize(M)
factors = []
for div in divisorize(fct):
    factors.append(num(div))

factors.sort()
k = M//N
L = [x for x in factors if x <= k]
print(max(L))

### FIXED CODE ###

N, M = map(int, input().split())

def primefactorize(n):
    fct = []  # return [[p1, power1], [p2, power2], ...]
    p, power = 2, 0
    while p * p <= n:
        while n % p == 0:
            n = n // p
            power += 1
        if power > 0:
            fct.append([p, power])
        if p == 2:
            p += 1
        else:
            p += 2
        power = 0
    if n > 1:
        fct.append([n, 1])
    return fct

def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]

def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a

if M != 1:
    fct = primefactorize(M)
    factors = []
    for div in divisorize(fct):
        factors.append(num(div))
else:
    factors = [1]
factors.sort()
k = M//N
L = [x for x in factors if x <= k]
print(max(L))
import collections
n=int(input())
xy=[]
for i in range(n):
    xy.append(list(map(int,input().split())))

dif=[]
for i in range(n):
    for k in range(i+1,n):
        dif.append([xy[i][0]-xy[k][0],xy[i][1]-xy[k][1]])
        dif.append([xy[k][0]-xy[i][0],xy[k][1]-xy[i][1]])
for i in range(len(dif)):
    dif[i]=str(dif[i])
c=collections.Counter(dif)
ans=list(c.values())
ans.sort(reverse=True)
print(n-ans[0])


### FIXED CODE ###

import collections
n=int(input())
xy=[]
for i in range(n):
    xy.append(list(map(int,input().split())))
dif=[]
for i in range(n):
    for k in range(i+1,n):
        dif.append([xy[i][0]-xy[k][0],xy[i][1]-xy[k][1]])
        dif.append([xy[k][0]-xy[i][0],xy[k][1]-xy[i][1]])
for i in range(len(dif)):
    dif[i]=str(dif[i])
c=collections.Counter(dif)
ans=list(c.values())
ans.sort(reverse=True)

if n==1:
    print(1)
else:
    print(n-ans[0])
a,b = input().rstrip().split()
A=int(a)
b.replace('.','')
B=int(b)
print(a*b)

### FIXED CODE ###

a,b = input().split()
A=int(a)
B=int(b.replace('.',''))
print((A*B)//100)
N = int(input())
Alist = list(map(int, input().split()))
memo = [{} for i in range(N)]

def ddp(cur_N, ai):
    if ai in memo[cur_N]:
        return memo[cur_N][ai]
    if cur_N >=N-1:
        return ai
    nx = Alist[cur_N+1]
    ret = max(ai + ddp(cur_N+1, nx), -ai + ddp(cur_N+1, -nx))
    memo[cur_N][ai] = ret
    return ret
print(ddp(0, Alist[0]))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
N = int(input())
Alist = list(map(int, input().split()))
memo = [{} for i in range(N)]

def ddp(cur_N, ai):
    if ai in memo[cur_N]:
        return memo[cur_N][ai]
    if cur_N >=N-1:
        return ai
    aj = Alist[cur_N+1]
    ret = max(ai + ddp(cur_N+1, aj), -1*ai + ddp(cur_N+1, -1*aj))
    memo[cur_N][ai] = ret
    return ret
print(ddp(0, Alist[0]))
N = int(input())
lis_X = list(map(int, input().split()))

lis_X_sorted = sorted(lis_X)

def calc_dif_sq(a,b):
    return (a-b)**2

res = []
for p in range(lis_X_sorted[0],lis_X_sorted[-1]):
    tmp = sum(list(map(lambda x:calc_dif_sq(x, p), lis_X_sorted)))
    res.append(tmp)
ans = min(res)
print(ans)

### FIXED CODE ###

N = int(input())
lis_X = list(map(int, input().split()))

lis_X_sorted = sorted(lis_X)

def calc_dif_sq(a,b):
    return (a-b)**2

if N == 1:
    ans = 0
elif min(lis_X_sorted)==max(lis_X_sorted):
    ans = 0
else :
    res = []
    for p in range(lis_X_sorted[0],lis_X_sorted[-1]):
        tmp = sum(list(map(lambda x:calc_dif_sq(x, p), lis_X_sorted)))
        res.append(tmp)
    ans = min(res)
print(ans)
print(input() + 1)

### FIXED CODE ###

print(chr(ord(input())+1))
import numpy as np

l = map(int, raw_input().split())
if l[0]==l[1]:
  print(l[2])
elif l[0] ==l[2]:
  print(l[1])
elif l[1] ==l[2]:
  print(l[0])

### FIXED CODE ###

l = list(map(int, input().split()))
if l[0]==l[1]:
	print(l[2])
elif l[0] ==l[2]:
	print(l[1])
elif l[1] ==l[2]:
	print(l[0])
i = input().split()

n,x = list(map(int, i))

l = input().split()

l = list(map(int, l))

step = [0]

c = 0

while step[-1] < x:
    c += 1
    step.append(step[c - 1] + l[c - 1])

print(len(step) - 1)

### FIXED CODE ###

n, x = map(int, input().split())
result, cur = 1, 0

for jump in map(int, input().split()):
    
    cur += jump
    
    if cur <= x:
        result += 1
    else:
        break

print(result)
import math
A,B,C,D = map(int,input().split())

C_mod0 = B//C - (A-1)//C
D_mod0 = B//D - (A-1)//D
CD_mod0 = B*math.gcd(C,D)//(C*D) -(A-1)*math.gcd(C,D)//(C*D)
Total = B - A + 1
ans = Total - C_mod0 - D_mod0 + CD_mod0

print(ans)


### FIXED CODE ###

A,B,C,D = map(int,input().split())

C_mod0 = B//C - (A-1)//C
D_mod0 = B//D - (A-1)//D
i = D
j = C % D
while j > 0:
    k = j
    j = i % j
    i = k

CD_mod0 = B*i // (C*D) - (A-1)*i // (C*D)
Total = B - A + 1
ans = Total - C_mod0 - D_mod0 + CD_mod0

print(ans)
def main():
    n, m = map(int, input().split())
    a = [input() for i in range(n)]
    b = [input() for i in range(m)]

    for row in range(n - m):
        current_index = 0
        for index in range(n - m):
            current_index = a[row].find(b[row], index)
            if current_index < 0:
                break

            for i in range(row, n - m):
                if a[i].find(b[i]) != current_index:
                    break
            else:
                print('Yes')
                return

    print('No')


if __name__ == "__main__":

    main()


### FIXED CODE ###

def main():
    n, m = map(int, input().split())
    a = [input() for i in range(n)]
    b = [input() for i in range(m)]

    for row in range(n - m + 1):
        current_index = 0
        for index in range(n - m + 1):
            current_index = a[row].find(b[0], index)
            if current_index < 0:
                break

            for i in range(m):
                if a[row + i].find(b[i], current_index) != current_index:
                    break
            else:
                print('Yes')
                return

    print('No')


if __name__ == "__main__":

    main()
i=input
for _ in[0]*int(i()):
 X,z=i(),[]
 for y in i():
  s=i=0
  for k in z:
   t=X.find(y,s)+1
   if t<1:break
   if t<k:z[i]=t
   s=k;i+=1
  else:
   t=X.find(y,s)+1
   if t:z+=[t]
 print(len(z))


### FIXED CODE ###

def m():
 e=input
 a=''
 for _ in[0]*int(e()):
  X,z=e(),[]
  for y in e():
   s=i=0
   for k in z:
    t=X.find(y,s)+1
    if t<1:break
    if t<k:z[i]=t
    s=k;i+=1
   else:
    t=X.find(y,s)+1
    if t:z+=[t]
  a+=f'\n{len(z)}'
 print(a[1:])
if'__main__'==__name__:m()
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    # 例えば、(A,B,C,D,E) = (5,3,4,2,6) だったら、D = 2の部分で絶対に人が詰まる
    # Dはボトルネック(一番処理がﾀﾞﾒ)
    # N = 100だとすると、最初にDに来てからはずっと2人ずつのせていく
    # 時間で言うと N // 2 = 50 分 かかる計算になる
    # しかし、全員ぴったりくるわけではないので、 (N + bottleneck - 1) // bottleneckにする
    # Dが一番小さいのだから、
    # Dにくるまでは、A,B,C の　3分
    # Dを過ぎてからはE の　1分
    # これは、ボトルネックがDの場合に限らない 合計で 4分
    n = int(input())
    bottleneck = int(input())
    for i in range(n-1):
        bottleneck = min(bottleneck,int(input()))
    #print(bottleneck)
    print((n + bottleneck - 1) // bottleneck + 4) # ボトネで処理するもの　と　来るまでと来た後　の合計

if __name__ == '__main__':
  main()


### FIXED CODE ###

#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    # 例えば、(A,B,C,D,E) = (5,3,4,2,6) だったら、D = 2の部分で絶対に人が詰まる
    # Dはボトルネック(一番処理がﾀﾞﾒ)
    # N = 100だとすると、最初にDに来てからはずっと2人ずつのせていく
    # 時間で言うと N // 2 = 50 分 かかる計算になる
    # しかし、全員ぴったりくるわけではないので、 (N + bottleneck - 1) // bottleneckにする
    # Dが一番小さいのだから、
    # Dにくるまでは、A,B,C の　3分
    # Dを過ぎてからはE の　1分
    # これは、ボトルネックがDの場合に限らない 合計で 4分
    n = int(input())
    bottleneck = float('inf')
    A = []
    for i in range(5):
        a = int(input())
        A.append(a)
    for i in range(5):
        bottleneck = min(bottleneck,A[i])
    #print(bottleneck)
    print((n + bottleneck - 1) // bottleneck + 4) # ボトネで処理するもの　と　来るまでと来た後　の合計

if __name__ == '__main__':
  main()
x=input()
if(x>=30):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

x=int(input())
if(x>=30):
  print("Yes")
else:
  print("No")
n,a=map(int,input().split())
X=[int(i)-a for i in input().split()]

memo={0:1}
for x in X:
    for k,v in list(memo.items()):
        memo[x+k]=memo.get(x+k,0)+v
        print(memo)
print(memo[0]-1)


### FIXED CODE ###

n,a=map(int,input().split())
X=[int(i)-a for i in input().split()]

memo={0:1}
for x in X:
    for k,v in list(memo.items()):
        memo[x+k]=memo.get(x+k,0)+v
print(memo[0]-1)
N, M = map(int, input().split())
A = []
B = []
for _ in range(M):
    a, b = map(int, input().split())
    A.append(a - 1)
    B.append(b - 1)

uf = [-1] * N
values = []
for i in range(M - 1, -1, -1):
    a = A[i]
    b = B[i]

    root_a = a if uf[a] < 0 else uf[a]
    root_b = b if uf[b] < 0 else uf[b]

    cur_a = root_a
    while 0 <= uf[cur_a]:
        cur_a = uf[cur_a]
    num_a = -uf[cur_a]

    cur_b = root_b
    while 0 <= uf[cur_b]:
        cur_b = uf[cur_b]
    num_b = -uf[cur_b]

    if root_a != root_b and 1 <= num_a and 1 <= num_b and cur_a != cur_b:
        values.append(num_a * num_b)

        uf[root_b] += uf[root_a]
        cur = uf[root_a]
        uf[root_a] = root_b
        while 0 <= cur and 0 <= uf[cur]:
            nxt = uf[cur]
            uf[cur] = root_b
            cur = nxt
    else:
        values.append(0)

total = 0
for v in reversed(values):
    total += v
    print(total)


### FIXED CODE ###

import io
import sys

lines = sys.stdin.read().splitlines()[::-1]


def readline():
    return lines.pop()


N, M = map(int, readline().split())
A = []
B = []
for _ in range(M):
    a, b = map(int, readline().split())
    A.append(a - 1)
    B.append(b - 1)

uf = [-1] * N
values = []
for i in range(M - 1, -1, -1):
    a = A[i]
    b = B[i]

    cur = a
    while 0 <= uf[cur]:
        cur = uf[cur]
    num_a = -uf[cur]
    root_a = cur
    cur = a
    while 0 <= uf[cur]:
        nxt = uf[cur]
        uf[cur] = root_a
        cur = nxt

    cur = b
    while 0 <= uf[cur]:
        cur = uf[cur]
    num_b = -uf[cur]
    root_b = cur
    cur = b
    while 0 <= uf[cur]:
        nxt = uf[cur]
        uf[cur] = root_b
        cur = nxt

    if root_a != root_b:
        values.append(num_a * num_b)

        if num_a < num_b:
            uf[root_b] += uf[root_a]
            cur = uf[root_a]
            uf[root_a] = root_b
            while 0 <= cur and 0 <= uf[cur]:
                nxt = uf[cur]
                uf[cur] = root_b
                cur = nxt
        else:
            uf[root_a] += uf[root_b]
            cur = uf[root_b]
            uf[root_b] = root_a
            while 0 <= cur and 0 <= uf[cur]:
                nxt = uf[cur]
                uf[cur] = root_a
                cur = nxt
    else:
        values.append(0)

total = 0
out = io.StringIO()
for v in reversed(values):
    total += v
    print(total, file=out)
print(out.getvalue())
#pythonだとsortでそのまま何文字でもソートしてくれる
n, l = map(int, input().split())
s = [input()  for _ in range(n)]]
print(''.join(sorted(s)))

### FIXED CODE ###

n, l = map(int, input().split())
s = [input()  for _ in range(n)]
print(''.join(sorted(s)))
A,P= map(int, input().split())
print((3*A+P)%2))


### FIXED CODE ###

A,P= map(int, input().split())
B=(3*A+P) // 2
print(B)
# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

# import sys
# input = sys.stdin.readline

A = int(input())
B = int(input())

if A > B:
    print("GREATER")
if B > A:
    print("LESS")
if A == B:
    Print("EQUAL")


### FIXED CODE ###

# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

# import sys
# input = sys.stdin.readline

A = int(input())
B = int(input())

if A > B:
    print("GREATER")
elif B > A:
    print("LESS")
else:
    print("EQUAL")
# -*- coding utf-8 -*-
N = int(input())
S = input()
K = int(input())

for s in 'abcdefghijklmnopqrstuvwxyz':
    if s != S[K]:
        S = S.replace(s, '*')
        
print(S)


### FIXED CODE ###

# -*- coding utf-8 -*-
N = int(input())
S = input()
K = int(input())

t = S[K - 1]
for s in 'abcdefghijklmnopqrstuvwxyz':
    if s != t:
        S = S.replace(s, '*')
        
print(S)
n=int(input())
s=input()
b=0
r=0
for i in range(0,n):
  if s[i]==B:
    b=b+1
  else:
    r=r+1
if r>b:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n=int(input())
s=input()
b=0
r=0
for i in range(0,n):
  if s[i]=='B':
    b=b+1
  else:
    r=r+1
if r>b:
  print('Yes')
else:
  print('No')
import math
n=int(input())
lists=list(map(int,input().split()))
gcds=lists[0]
for x in range(n-1):
    if n==0:
        gcds=math.gcd(lists[0],lists[1])
    else:
        add=math.gcd(lists[x],lists[x+1])
        gcds=math.gcd(gcds,add)
print(gcds)


### FIXED CODE ###

import fractions
n=int(input())
lists=list(map(int,input().split()))
gcds=lists[0]
for x in range(n-1):
    if n==0:
        gcds=fractions.gcd(lists[0],lists[1])
    else:
        add=fractions.gcd(lists[x],lists[x+1])
        gcds=fractions.gcd(gcds,add)
print(gcds)
import sys
input = sys.stdin.readline
def print_ans(H, W, h, w):
    """Test Case
    >>> print_ans(3, 2, 2, 1)
    1
    >>> print_ans(5, 5, 2, 3)
    6
    >>> print_ans(2, 4, 2, 4)
    0
    """
    print((H - h) * (W  -w))


if __name__ == '__main__':
    H, W = map(int, input().rstrip().split())
    h, w = map(int, input().rstrip().split())
    print_ans(b)




### FIXED CODE ###

import sys
input = sys.stdin.readline
def print_ans(H, W, h, w):
    """Test Case
    >>> print_ans(3, 2, 2, 1)
    1
    >>> print_ans(5, 5, 2, 3)
    6
    >>> print_ans(2, 4, 2, 4)
    0
    """
    print((H - h) * (W  -w))


if __name__ == '__main__':
    H, W = map(int, input().rstrip().split())
    h, w = map(int, input().rstrip().split())
    print_ans(H, W, h, w)
# -*- coding: utf-8 -*-
import sys
N,M=list(map(int,raw_input().split()))

nl=[[] for i in range(N+1)]
for i in range(M):
	x,y=map(int,raw_input().split())
	nl[x].append(y)
	nl[y].append(x)	
#print nl


def dfs(v):
	F[v]=1
	for i in nl[v]:
		if color[v]=="w" and color[i]==0:
			color[i]="b"
		elif color[v]=="b" and color[i]==0:
			color[i]="w"				
		elif color[v]==color[i]:
			#２部グラフではない
			print N*(N-1)/2-M
			sys.exit()
		#print v,i,color,F
		
		if F[i]==0:
			dfs(i)


F=[0]*(N+1)
color=[0]*(N+1)
color[1]="w"
dfs(1)

#２部グラフの場合
print color.count("b")*color.count("w")-M




### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**7)
N,M=list(map(int,raw_input().split()))

nl=[[] for i in range(N+1)]
for i in range(M):
	x,y=map(int,raw_input().split())
	nl[x].append(y)
	nl[y].append(x)	
#print nl


def dfs(v):
	F[v]=1
	for i in nl[v]:
		if color[v]=="w" and color[i]==0:
			color[i]="b"
		elif color[v]=="b" and color[i]==0:
			color[i]="w"				
		elif color[v]==color[i]:
			#２部グラフではない
			print N*(N-1)/2-M
			sys.exit()
		else:
			continue
		#print v,i,color,F
		
		if F[i]==0:
			dfs(i)


F=[0]*(N+1)
color=[0]*(N+1)
color[1]="w"
dfs(1)

#２部グラフの場合
print color.count("b")*color.count("w")-M
import fractions
n,k = map(int,input().split())
ai = [int(i) for i in input().split()]

g = fractions.gcd(ai[0],ai[1])

for i in range(1,n-1):
    #print(i)
    g = fractions.gcd(g,ai[i+1])

if k % g == 0 and max(ai) >= k:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

### FIXED CODE ###

import fractions
n,k = map(int,input().split())
ai = [int(i) for i in input().split()]

if n == 1:
    if k == ai[0]:
        print('POSSIBLE')
        exit()
    else:
        print('IMPOSSIBLE')
        exit()

g = fractions.gcd(ai[0],ai[1])

for i in range(1,n-1):
    #print(i)
    g = fractions.gcd(g,ai[i+1])

if k % g == 0 and max(ai) >= k:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
t1, t2 = map(int, input().split())
a1, a2 = map(int, input().split())
b1, b2 = map(int, input().split())
first = a1 * t1 - b1 * t1
second = (a2 * t2 - b2 * t2)
last = second + first
if first * last > 0:
    ans = 0
elif (abs(last) == 0):
    ans = 'infinity'
else:
    ans = math.ceil(abs(first) / abs(last))
print(ans)

### FIXED CODE ###

t1, t2 = map(int, input().split())
a1, a2 = map(int, input().split())
b1, b2 = map(int, input().split())
first = a1 * t1 - b1 * t1
second = (a2 * t2 - b2 * t2)
last = second + first
if first * last > 0:
    ans = 0
elif (abs(last) == 0):
    ans = 'infinity'
else:
    s = abs(first) // abs(last)
    t = abs(first) % abs(last)
    ans = 2 * s
    if t != 0:
        ans += 1
print(ans)
n, k = map(int, input().split())
vs = list(map(int, input().split()))

values = []

for num_enqueue in range(k // 2):
  for num_dequeue in range(k-num_enqueue+1):
    for num_dequeue_left in range(num_dequeue+1):
      num_dequeue_right = num_dequeue - num_dequeue_left
      if num_dequeue >= n:
        dequeued = vs[:]
      else:
        dequeued = vs[:num_dequeue_left] + ([] if num_dequeue_right == 0 else vs[-num_dequeue_right:])
      dequeued_pos = [v for v in dequeued if v >= 0]
      dequeued_neg = sorted([v for v in dequeued if v < 0], reverse=True)

      for _ in range(num_enqueue):
        if dequeued_neg:
          dequeued_neg.pop()
      value = sum(dequeued_pos) + sum(dequeued_neg)
      #print(f'value={value}, enq={num_enqueue}, left={num_dequeue_left}, right={num_dequeue_right}, dequeued={dequeued}')
      values.append(value)

#print(values)
print(max(values))




### FIXED CODE ###

n, k = map(int, input().split())
vs = list(map(int, input().split()))

values = []

if k > 1:
  for num_enqueue in range(k // 2):
    for num_dequeue in range(k-num_enqueue+1):
      for num_dequeue_left in range(num_dequeue+1):
        num_dequeue_right = num_dequeue - num_dequeue_left
        if num_dequeue >= n:
          dequeued = vs[:]
        else:
          dequeued = vs[:num_dequeue_left] + ([] if num_dequeue_right == 0 else vs[-num_dequeue_right:])
        dequeued_pos = [v for v in dequeued if v >= 0]
        dequeued_neg = sorted([v for v in dequeued if v < 0], reverse=True)

        for _ in range(num_enqueue):
          if dequeued_neg:
            dequeued_neg.pop()
        value = sum(dequeued_pos) + sum(dequeued_neg)
        #print(f'value={value}, enq={num_enqueue}, left={num_dequeue_left}, right={num_dequeue_right}, dequeued={dequeued}')
        values.append(value)
  print(max(values))
else:
  print(max(vs[0], vs[-1], 0))
import sys
from collections import deque

n, *a = map(int, sys.stdin.read().split())

def main():
    b = deque()
    for i in range(n):
        if (i & 1): b.appendleft(a[i])
        else: b.append(a[i])
    if (n & 1): b = b[::-1]
    print(*b, sep=' ')

if __name__ ==  '__main__':
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline


n = int(input().rstrip())
a = [a for a in input().split()]

b = [None] * n
for i in range(n):
    if i % 2 == 0: b[n // 2 + i // 2] = a[i]
    else: b[n // 2 - (-(-i // 2))] = a[i]
if (n - 1) % 2 == 0: b = list(reversed(b))

for elem in b: print(elem, end=' ')
N = int(raw_input())
a = raw_input()
aa = a.split(" ")
aaa = []
for i in range(len(aa)):
	aaa.append((i+1,int(aa[i])))

ctr = 0

# for (a,b) in aaa:
# 	if (b,a) in aaa:
# 		aaa.remove((a,b))
# 		aaa.remove((b,a))
# 		ctr = ctr + 1

print(str(ctr))

### FIXED CODE ###

s = raw_input()
s2 = s[:4] + " " + s[4:]
print(s2)
N, M = map(int, input().split())
PS = []
for i in range(M):
    p, s = input().split()
    PS += [(int(p),s)]

CA = 0
PN = 0
l = [True]*M
for i in range(len(PS)):
    if l[PS[i][0]]:
        if PS[i][1] == "WA":
            PN += 1
        elif PS[i][1] == "AC":
            CA += 1
            l[PS[i][0]] = False

print(CA, PN)

### FIXED CODE ###

N, M = map(int, input().split())
P = []
S = []
for i in range(M):
    p, s = input().split()
    P += [int(p)]
    S += [s]

CA = 0
PN = 0
d = {key:0 for key in P}
for i in range(len(P)):
    if d[P[i]] >= 0:
        if S[i] == "WA":
            d[P[i]] += 1
        elif S[i] == "AC":
            PN += d[P[i]]
            CA += 1
            d[P[i]] = -1

print(CA, PN)
n, k = map( int, input().split() )
mod = 10 ** 9 + 7
 
numer = [ 1 ] * ( n + 1 )
demon = [ 1 ] * ( n + 1 )
 
for i in range( 1, n + 1 ):
  numer[ i ] = numer[ i - 1 ] * i % mod

demon[ n ] = pow( numer[ n ], mod - 2, mod )
for i in range( n, 0, -1 ):
  demon[ i - 1 ] = ( demon[ i ] * i ) % mod

def nCr( n, r ):
  if r < 1:
    return 1
  return ( numer[ n ] * demon[ r ] % mod ) * demon[ n - r ] % mod
 
ans = 0
for i in range( max( k, n - 1) + 1 ):
  ans = ans + nCr( n, i ) * nCr( n - 1, i - 1 )
print( ans )

### FIXED CODE ###

n, k = map( int, input().split() )
mod = 10 ** 9 + 7
 
numer = [ 1 ] * ( n + 1 )
demon = [ 1 ] * ( n + 1 )
 
for i in range( 1, n + 1 ):
  numer[ i ] = numer[ i - 1 ] * i % mod

demon[ n ] = pow( numer[ n ], mod - 2, mod )
for i in range( n, 0, -1 ):
  demon[ i - 1 ] = ( demon[ i ] * i ) % mod

def nCr( n, r ):
  if r < 1:
    return 1
  return ( numer[ n ] * demon[ r ] % mod ) * demon[ n - r ] % mod
 
ans = 0
for i in range( min( k, n - 1) + 1 ):
  ans = ( ans + nCr( n, i ) * nCr( n - 1, i )) % mod
print( ans )
N = int(input())

MAX = 55555 * 5


def create_prime_list(n):
    if n < 2:
        return []
    prime_list = [2]
    x = 3
    while x <= n:
        flag = False
        for p in prime_list:
            if x < p ** 2:
                flag = True
                break
            if x % p == 0:
                break
        if flag:
            prime_list.append(x)
        x += 2
    return prime_list


def main():
    prime_list = create_prime_list(MAX)
    prime_set = set(prime_list)
    w = [[] for _ in range(6)]
    w[0].append(0)
    l = []
    i = 0
    while i < 5:
        p = prime_list[i]
        i += 1
        l.append(p)
        for j in range(3, -1, -1):
            for x in w[j]:
                w[j + 1].append(x + p)
    
    while len(l) < N:
        p = prime_list[i]
        i += 1
        flag = True
        for x in w[4]:
            if x + p in prime_set:
                flag = False
                break
        if flag:
            l.append(p)
            for j in range(3, -1, -1):
                for x in w[j]:
                    w[j + 1].append(x + p)
    
    print(*l)
    

if __name__ == "__main__":
    main()


### FIXED CODE ###

N = int(input())

MAX = 55555


def create_prime_list(n):
    if n < 2:
        return []
    prime_list = [2]
    x = 3
    while x <= n:
        flag = False
        for p in prime_list:
            if x < p ** 2:
                flag = True
                break
            if x % p == 0:
                break
        if flag:
            prime_list.append(x)
        x += 2
    return prime_list


def main():
    prime_list = create_prime_list(MAX)
    w = [x for x in prime_list if x % 5 == 1]
    print(*w[:N])
    

if __name__ == "__main__":
    main()