Harryxun/stf_run huggingface dataset:
n = int(input())
s = input()
x = 0
for i in range(n+1):
    f = set(s[i:])
    d = set(s[:i])
    count =len(f & d)
    if count > x:
        x = count
print(x)
n = int(input())
s = input()
c = 0
for i in range(n+1):
    f = set(s[i:])
    d = set(s[:i])
    count =len(f & d)
    if count > c:
        c = count
print(c)

### FIXED CODE ###

n = int(input())
s = input()
x = 0
for i in range(n+1):
    f = set(s[i:])
    d = set(s[:i])
    count =len(f & d)
    if count > x:
        x = count
print(x)
from statistics import median
q0=int(input())
ind=0
a=[]
b=[]
for iii in range(q0):
  q=[int(_) for _ in input().split()]
  lenq=len(q)
  if lenq==1:
    meda=median(a)
    ind=sum([abs(_a-meda) for _a in a])+sum(b)
    i=1
    while sum([abs(_a-i-meda) for _a in a])+sum(b)==ind:
      i+=1
    print(int(meda-i+1),int(ind))
  elif lenq==3:
    a.append(q[1])
    b.append(q[2])

### FIXED CODE ###

import heapq as h
q_num=int(input())
bsum=0
high=[]
low=[]
asum=0
for iii in range(q_num):
  q=[int(_) for _ in input().split()]
  if q[0]==1:
    bsum+=q[2]
    if len(low)==0:
      h.heappush(low,-q[1])
    else:
      asum+=abs(q[1]+low[0])
      if -low[0]>=q[1]:
        h.heappush(low,-q[1])
      else:
        h.heappush(high,q[1])
      
    if len(low)>=len(high)+2:
      ltoh=h.heappop(low)
      h.heappush(high, -ltoh)
    elif len(high)>=len(low)+1:
      ltoh=h.heappop(high)
      asum+=-low[0]-ltoh
      h.heappush(low, -ltoh)
  else:
    print(-low[0],asum+bsum)
import sys
n = int(input())
pos = [list(map(int,input().split())) for p in range(n)]
for i in range(len(pos)):
  if i == 0:
    num = abs(pos[i][1]-0) + abs(pos[i][2]-0)
    if num <= diff and diff * (diff%2) == num%2:
      pass
    else:
      print("No")
      sys.exit()     
  else:
    diff = pos[i][0]-pos[i-1][0]
    num = abs(pos[i][1]-pos[i-1][1]) + abs(pos[i][2]-pos[i-1][2])
    if num <= diff and diff * (diff%2) == num%2:
      pass
    else:
      print("No")
      sys.exit()      
print("Yes")
    


### FIXED CODE ###

n=int(input())
x,y=0,0
t=0
for i in range(n):
    T,X,Y=map(int,input().split())
    if((T-t)>=(abs(X-x)+abs(Y-y)) and (T-t)%2==(abs(x-X)+abs(Y-y))%2):
        x=X
        y=Y
        t=T
    else:
        print("No")
        exit()
print("Yes")
# -*- coding: utf-8 -*-
length, count = list(map(int, input().split()))

words = []
for i in range(count):
  s = input()
  if len(s) != length:
    continue
  words.append(s)

words = sorted(words)

r = ''.join(words)
print(r)

### FIXED CODE ###

# -*- coding: utf-8 -*-
count, length = list(map(int, input().split()))

words = []
for i in range(count):
  s = input()
  if len(s) != length:
    continue
  words.append(s)

words = sorted(words)

r = ''.join(words)
print(r)
a, b = list(input().strip().split(" ")

print(b-a+1)

### FIXED CODE ###

a, b = list(map(int, input().strip().split(" ")))
print(a-b+1)
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(H: int, W: int, s: "List[str]"):
    s = ["."*(W+2)]+["."+ss+"."for ss in s]+["."*(W+2)]
    direction = ((0,1),(1,0),(0,-1),(-1,0))
    # 全ての黒マスの上下左右に一つでも黒マスがあればおk
    for i in range(H+2):
        for j in range(W+2):
            if s[i][j] == ".":
                continue
            
            for x,y in direction:
                if s[i+x][j+y] == "#":
                    break
            else:
                print(NO)
                return 
    
    print(YES)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    s = [next(tokens) for _ in range(W)]  # type: "List[str]"
    solve(H, W, s)

if __name__ == '__main__':
    main()


### FIXED CODE ###

h,w = map(int,input().split())
cambus = [list(input()) for _ in range(h)]
import sys
for i in range(h):
  for j in range(w):
    if cambus[i][j]=="#":
      b = []
      if i != 0:
        b.append(cambus[i-1][j] == "#")
      if i != h-1:
        b.append(cambus[i+1][j] == "#")
      if j != 0:
        b.append(cambus[i][j-1] == "#")
      if j != w-1:
        b.append(cambus[i][j+1] == "#")

      if not any(b):
        print("No")
        sys.exit()

print("Yes")
N, M, C = map(int,input().split(' '))
import numpy as np
B = np.array(list(map(int,input().split(' '))))
def f(A, B, C):
    A = np.array(list(map(int,A.split(' '))))
    return np.sum(A*B) +C >  0
print(

### FIXED CODE ###

N, M, C = map(int,input().split(' '))
import numpy as np
B = np.array(list(map(int,input().split(' '))))
def f(A, B, C):
    A = np.array(list(map(int,A.split(' '))))
    return np.sum(A*B) +C >  0
print(np.sum([f(input(), B, C) for i in range(N)]))
import sys
r=sys.stdin.readline
for e in iter(r,'0 0\n'):
 N,M=map(int,e.split())
 k,p=1,0
 S=[int(r()) for _ in[0]*N]
 for d in[int(r())for _ in[0]*M]:
  p+=d;
  if N<=p:p+=S[p]
  if N<=p+1:break
  k+=1
 print(k)


### FIXED CODE ###

import sys
r=sys.stdin.readline
for e in iter(r,'0 0\n'):
 N,M=map(int,e.split())
 k,p=1,0
 S=[int(r())for _ in[0]*N]
 for d in[int(r())for _ in[0]*M]:
  p+=d;
  if p<N:p+=S[p]
  if N<=p+1:break
  k+=1
 print(k)
n = input()
a = map(int, raw_input().split())
color = [0 for _ in range(9)]
for item in a:
    i = item / 400
    color[i] += 1

ans = 0
for num in color[0:8]:
    if num != 0:
        ans += 1

min_ans = ans
max_ans = ans + color[8]
max_ans = max(min(max_ans, 9), 1)

print min_ans, max_ans


### FIXED CODE ###

n = input()
a = map(int, raw_input().split())
color = [0 for _ in range(9)]
for item in a:
    i = item / 400
    i = min(i, 8)
    color[i] += 1

ans = 0
for num in color[0:8]:
    if num != 0:
        ans += 1

min_ans = max(ans, 1)
max_ans = ans + color[8]
#max_ans = min(max_ans, 8)

print min_ans, max_ans
N = int(input())

#x_max, y_max = 0, 0

xy = []
for i in range(N):
    xi, yi = map(int, input().split())
    xy.append((xi, yi))

t = 10**9
vectors = []

x1, x2, y1, y2, xd, yd = 0, 0, 0, 0, 0, 0
for i in range(N):
    for j in range(i+1, N):
        x1, y1 = xy[i]
        x2, y2 = xy[j]
        if x1 > x2:
            xd = x1 - x2
        elif x2 > x1:
            xd = x2 - x1
        else:
            continue
        if y1 > y2:
            yd = y1 - y2
        elif y2 > y1:
            yd = y2 - y1
        else:
            continue

        vectors.append((xd, yd))

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

frequencies_dic = {}
M = len(vectors)
for i in range(M):
    x, y = vectors[i]
    if (x, y) not in frequencies_dic:
        frequencies_dic[(x,y)] = 1
    else:
        frequencies_dic[(x,y)] += 1

ans = max(list(frequencies_dic.values()))
print(ans)

### FIXED CODE ###


N = int(input())

xy = []
for i in range(N):
    xi, yi = map(int, input().split())
    xy.append((xi, yi))


vectors = []

x1, x2, y1, y2, xd, yd = 0, 0, 0, 0, 0, 0
for i in range(N):
    for j in range(i+1, N):
        x1, y1 = xy[i]
        x2, y2 = xy[j]

        vectors.append((x1-x2, y1-y2))
        vectors.append((x2-x1, y2-y1))

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

frequencies_dic = {}
M = len(vectors)
for i in range(M):
    x, y = vectors[i]
    if (x, y) not in frequencies_dic:
        frequencies_dic[(x,y)] = 1
    else:
        frequencies_dic[(x,y)] += 1
if N == 1:
    print(1)
else:
    zeros = max(list(frequencies_dic.values()))
    ans = N - zeros
    print(ans)
n = input()
if n[0] == n[1]:
    if n[0] == n[2] or n[0] == n[3]:
        print("Yes")
    else:
        print("No")
else:
    if n{1} != n[2]:
        print("No")
    else:
        print("Yes")


### FIXED CODE ###

n = input()
if n[0] == n[1]:
    if n[0] == n[2]:
        print("Yes")
    else:
        print("No")
else:
    if n[1] != n[2] or n[1] != n[3]:
        print("No")
    else:        
        print("Yes")
import collections

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

X = []
for i in range(M):
    Aj, Bj = map(int,input().split())
    if H[Aj - 1] < H[Bj - 1]:
       X.append(Aj)
    elif H[Bj - 1] < H[Aj - 1]:
       X.append(Bj)
    elif H[Aj - 1] == H[Bj - 1]:
        X.append(Aj)
        X.append(Bj)

low_H = collections.Counter(X)
ans = N - len(low_H)
print(ans)


### FIXED CODE ###

import collections

N, M = map(int,input().split())
H = [int(i) for i in input().split()]

X = []
for i in range(M):
    Aj, Bj = map(int,input().split())
    if H[Aj - 1] < H[Bj - 1]:
       X.append(Aj)
    elif H[Bj - 1] < H[Aj - 1]:
       X.append(Bj)
    elif H[Aj - 1] == H[Bj - 1]:
        X.append(Aj)
        X.append(Bj)

low_H = collections.Counter(X)
ans = N - len(low_H)
print(ans)
a, b = map(int, raw_input(). split())
return a * b 2 * (a + b)

### FIXED CODE ###

a, b = map(int, raw_input(). split())
print a * b, 2 * (a + b)
#B問題
N, K = map(int, input().split())
Result = [True] * N
for i in range(K):
    d = int(input())
    A = input().split()
    for j in range(len(A_i)):
        Result[A_i[j]-1] = False

count = Result.count(True)
print(count)

### FIXED CODE ###

#B問題
N, K = map(int, input().split())
Result = [True] * N
Count = 0
for i in range(K):
    d = int(input())
    A = input().split()
    for j in range(len(A)):
        Result[int(A[j])-1] = False

Count = Result.count(True)
print(Count)
n,k=map(int,input().split())
s=input()
if s[k-1]==A:
  s=s[:k-1]+'a'+s[k:]
elif s[k-1]==B:
  s=s[:k-1]+'b'+s[k:]
else:
  s=s[:k-1]+'c'+s[k:]
print(s)

### FIXED CODE ###

n,k=map(int,input().split())
s=input()
if s[k-1]=='A':
  s=s[:k-1]+'a'+s[k:]
elif s[k-1]=='B':
  s=s[:k-1]+'b'+s[k:]
else:
  s=s[:k-1]+'c'+s[k:]
print(s)
n, x, y = map(int, input().split())
cnt = [0] * n
# 漸化式が建てられそうでめんどくさい場合は、片方を固定する
# 端点を固定する 1..n-2 から順に大きい頂点に向かって伸びていく
for i in range(n - 1):
    for j in range(i + 1, n):
        if i <= x - 1:
            if j <= x - 1:  # 1 idx
                cnt[j - i] += 1
            elif j <= y - 1:
                cnt[min(j - i, x + y - i - j - 1)] += 1
            else:
                cnt[x - y - i + j + 1] += 1
        elif x - 1 < x <= y - 1:
            if j <= y - 1:
                cnt[min(j - i, 1 + (i - x + 1) + (y - 1 - j))] += 1
            else:
                cnt[min(j - i), 1 + (i - x + 1) + (j - y + 1)] += 1
        else:
            cnt[j - i] += 1

for i in range(1, n):
    print(cnt[i])


### FIXED CODE ###

#!/usr/bin/env python3
n,x,y = map(int,input().split())
# 問題 nC2 の中から、最短距離がk になる頂点の組み合わせをそれぞれ求める
# n <= 2*10**3なのでnC2は回る。O(1)に行ける
if x > y: x,y = y,x
#x < y
ans = [0]*n#出力は 0　消す
for i in range(1,n):
    for j in range(i+1,n+1):# i < jとする
        # パターン 1 [x,y]の両方外
        if y <= i or j <= x:
            k = j-i
            ans[k] += 1
        # パターン2 片方が[i,j]の内側
        elif (x<=i and i <= y and y <= j):
            k = min(j-i,i-x+j-y+1)
            ans[k] += 1
        # 片方が内側 i,x,j,y
        elif (i<=x and x <= j and j<=y):
            k = min(j-i,y-j+1+x-i)
            ans[k] += 1
        elif i <=x and y <= j:
            k = x-i+1+j-y
            ans[k] += 1
        else:#両方[x,y]の内側 x,i,j,y
            k = min(j-i,1+i-x+y-j)
            ans[k] += 1
        #print(i,j,k)
for i in range(1,n):
    print(ans[i])
def dfs(now, prev = -1):
    for nx in connect[now]:
        if nx == prev: continue
        score[nx] += score[now]
        dfs(nx, now)

N, Q = map(int, input().split())
connect = {i:set() for i in range(1, N+1)}
for _ in range(N-1):
    a, b = map(int, input().split())
    connect[a].add(b)
    connect[b].add(a)
score = {i:0 for i in range(1, N+1)}
for _ in range(Q):
    p, x = map(int, input().split())
    score[p] += x

dfs(1)
print(*score.values())

### FIXED CODE ###

from collections import deque
 
N, Q = map(int, input().split())
Ki = [[] for _ in range(N)]
for _ in range(N-1):
    p, c = map(int, input().split())
    Ki[p-1].append(c-1)
    Ki[c-1].append(p-1)
S = [0]*N
for _ in range(Q):
    node, score = map(int, input().split())
    S[node-1] += score
 
stack = deque([0])
done = [0]*N
done[0] = 1
 
while len(stack) > 0:
    now = stack.pop()
    
    for new in Ki[now]:
        if done[new] == 0:
            done[new] = 1
            stack.append(new)
            S[new] += S[now]
    
print(*S)
import numpy as np
import heapq
import copy
from operator import itemgetter


n = int(input())
a = list(map(int, input().split()))

for k in range(1, n+1):
    _, counts = np.unique(a, return_counts=True)
    counts = sorted(list(counts), reverse=True)
    
    eat = 0
    while True:
        if np.count_nonzero(counts) < k:
            break
        else:
            for i in range(k):
                counts[i] -= 1
            eat += 1
            counts = sorted(list(counts), reverse=True)
            
    print(eat)
            

### FIXED CODE ###

import collections
import numpy as np

# リストarrからx個の同じ長さの列を取り出す時の最大の長さ
# 発想: x個取り出す時、ある文字をx個より多く取り出して列に含むことはない
#       一方ある文字をその文字がある数よりも取り出して使うこともできない
#       つまり、min(arr.count(a), x)で、x個の同じ長さの列に使えるaの数がわかる
#       さらに、sum(min(arr.count(a),x))で、x個の同じ長さの列に使える文字の数がわかる
#       よって、sum(min(arr.count(a),x))//xで、x個の同じ長さの列の長さがわかる
#       発展的に、longest(arr,x)までの計算状況からlongest(arr,x+1)が計算できる
# def longest(arr, x):    # legacy
#     return sum(min(arr.count(a), x) for a in arr) // x


n = int(input())
a = list(map(int, input().split()))

counter = collections.Counter(a)        #O(n)
nums = list(counter.values())           #O(n)
num_counter = collections.Counter(nums) #O(n)
lastest_add = np.count_nonzero(nums)    #O(n)
building, longests = [0], [0]
for i in range(1, n+1):                 #O(n)
    appended = building[-1] + lastest_add   #O(1)
    building.append(appended)               #O(1)
    longests.append(appended // i)          #O(1)
    lastest_add -= num_counter[i]           #O(1)


lastest_longest = 0
k_most = []
for i, x in enumerate(reversed(longests)):
    while x > lastest_longest:
        lastest_longest += 1
        k_most.append(n-i)

k_most.extend([0]*(n-len(k_most)))      # zero padding

for longests_num in k_most:
    print(longests_num)

# print('----------------')
# for k in range(1, n+1):
#     maxindexes = list(i for i, x in enumerate(longests) if x >= k)
#     if maxindexes:
#         print(maxindexes[-1])
#     else:
#         print(0)
a,b,c=map(int, input().split())
list = [a,b,c]
s = 0
for i in range (3):
  if list[i] == 1:
    s += 1
print(s)

### FIXED CODE ###

print(list(input()).count("1"))
h = [2,4,5,7,9]
p = [0,1,6,8]
b = [3]

n = input()

n = n % 10

if n in h:
  print 'hon'
elif n in p:
  print 'pon'
elif n in b:
  print 'bon'

### FIXED CODE ###

h = [2,4,5,7,9]
p = [0,1,6,8]
b = [3]

n = int(input())

n = n % 10

if n in h:
  print('hon')
elif n in p:
  print('pon')
elif n in b:
  print('bon')
k,x = map(int,input().split())

lis = [x]
x_1 = x
x_2 = x

for i in range(k-1):
    x_1 += 1
    x_2 -= 1
    lis.append(x_1)
    lis.append(x_2)
new_list = sorted(lis)

print(" ".join(new_list))

### FIXED CODE ###

k,x = map(int,input().split())

lis = []
for i in range(x-k+1, x+k):
    lis.append(i)

print(" ".join(map(str,lis)))
s = input()
k = int(input())

words = set()

l = len(s)

for i in range(1,k+1):
    for j in range(l-k):
        words.add(s[j:i+j])

sort_word = sorted(words)
print(sort_word[k-1])

### FIXED CODE ###

s = input()
k = int(input())

words = set()

l = k+1 if len(s) > k else len(s) + 1

for i in range(1,l):
    for j in range(len(s)):

        words.add(s[j:i+j])

sort_word = sorted(words)

print(sort_word[k-1])
n, q = map(int, input().split())

#print(n,q)
edge = []
for i in range(n-1):
    a = list(map(int, input().split()))
    edge.append(a)

add_list = []
for i in range(q):
    p = list(map(int, input().split()))
    add_list.append(p)

#print(edge,add_list)


dir_edge = [[] for i in range(n)]

for e in edge:
    dir_edge[e[0]-1].append(e[1]-1)
    dir_edge[e[1]-1].append(e[0]-1)
#print(dir_edge)


add_value = [0]*n
for v in add_list:
    add_value[v[0]-1] += v[1]
#print(add_value)


ans = [-1] *n
def dfs(index, parent,value):
    value += add_value[index]
    ans[index] = value
    for i in dir_edge[index]:
        if (parent == i):
            continue
        dfs(i,index,value)
        

dfs(0, -1, 0)
print(*ans)

### FIXED CODE ###

n,q = map(int,input().split())

#print(n,q)
edge=[]
for i in range(n-1):
    a = list(map(int,input().split()))
    edge.append(a)

add_list = []
for i in range(q):
    p = list(map(int,input().split()))
    add_list.append(p)

#print(edge,add_list)

ans = [0] * n
edge_list = [-1] * n

for e in edge:
    edge_list[e[1]-1] = e[0]-1

add_value = [0]*n
for v in add_list:
    add_value[v[0]-1] += v[1]

#print(edge_list)
#print(add_value)


dp = [-1] * n
def get_value(i):
    if(dp[i]!=-1):
        return dp[i]
    tmp = add_value[i]
    if edge_list[i] != -1:
        tmp += get_value(edge_list[i])
    dp[i] = tmp
    return dp[i]

for i in range(n):
    ans[i] = get_value(i)
    #print(i,ans)

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

	for i in range(N):
		l[i] = int(l[i])

	for i in range(1, N - 1):
		v = l[i]
		j = i - 1
		while j >= 0 and l[l] > v:
			A[j + 1] = A[j]
			j -= 1
		A[j + 1] = v
		print(l[0],l[1],l[2],l[3],[4],l[5])


### FIXED CODE ###

def listprint(lists):
	global N
	count = 0
	for i in lists:
		count += 1
		if count < N:
			print(i, end = ' ')
		if count == N:
			print(i)

if __name__ == '__main__':
	N = int(input())
	l = input().split()

	for i in range(N):
		l[i] = int(l[i])

	listprint(l)

	for i in range(1, N):
		v = l[i]
		j = i - 1

		while j >= 0 and l[j] > v:
			l[j + 1] = l[j]
			j -= 1

		l[j + 1] = v
		listprint(l)
s = float(i)**2 * 3.14159265359
l = float(i)*2*3.14159265359
print(s, l)



### FIXED CODE ###

r = float(input())
s = r**2 * 3.14159265359
l = r*2 * 3.14159265359
print(s, l)
import numpy as np
 
def main():
    numbers=[]
    a,b,k = map(int,input().split())
    numbers=np.arange(a,b+1)
    A=set(numbers[:k])
    B=set(numbers[-k:])
    answer = A|B
    
    for i in sorted(answer):
        print("{}".format(i))
 
 
if __name__=="__main__":
    main()

### FIXED CODE ###

a, b, k = [int(i) for i in input().split()]

lim_1 = min(a + k, b)
lim_2 = max(b - k + 1, a)
ans = set(list(range(a, lim_1)) + list(range(lim_2, b + 1)))

for n in ans:
    print(n)
for i in range(1, 21):
    if a * i > b:
        break

    if b % (a * i) == 0:
        print(a + b)
        break
else:
    print(b - a)

### FIXED CODE ###

from sys import stdin

a, b = stdin.readline().rstrip().split()
a, b = int(a), int(b)

for i in range(1, 21):
    if a * i > b:
        print(b - a)
        break

    if b % (a * i) == 0:
        print(a + b)
        break
else:
    print(b - a)
# import math
import fractions
n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
a = sorted(a)
if n == 1:
    if a[0] == k:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
div = fractions.gcd(a[0], a[1])
for i in range(n):
    if a[i] == k:
        print("POSSIBLE")
        exit()
    elif i >= 2:
        div = fractions.gcd(a[i], a[i-1])
if k % div == 0 and k <= a[-1]:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
"""
b = []
for i in range(len(a)):
    if a[i] == k:
        print("POSSIBLE")
        exit()
    elif a[i] > k:
      b.append(a[i] - k)
      del(a[i])
print(a)
print(b)
"""

### FIXED CODE ###

# import math
# import fractions
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
a = sorted(a)

div = a[0]
for i in range(1, n):
    div = gcd(div, a[i])

if k % div == 0 and k <= a[-1]:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
n, *a = map(int, open(0).read().split())
a.sort()
if a[0]!=0:
    print(0)
    exit()

b = [0]*n
for i in a: b[i]+=1

if b[0]!=1:
    print(0)
    exit()

ans = 1
i = 0
while 1:
    if b[i]==0:
        if sum(b[i:])>0:
            print(0)
            exit()
        else:
            break
    ans *= b[i]**b[i+1]
    i += 1

print(ans)

### FIXED CODE ###

n, *a = map(int, open(0).read().split())
if a[0]!=0:
    print(0)
    exit()

b = [0]*n
for i in a: b[i]+=1

if b[0]!=1:
    print(0)
    exit()

ans = 1
i = 0
while i<n-1:
    if b[i]==0:
        if sum(b[i:])>0:
            print(0)
            exit()
        else:
            break
    ans *= b[i]**b[i+1]
    i += 1

print(ans%998244353)
X, Y, Z = map(int, input())
print(Z, X, Y)


### FIXED CODE ###

X, Y, Z = map(int, input().split())
print(Z, X, Y)
from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
import sys
INF = float('inf')
mod = 10**9+7


def lcm(a, b): return a * b / gcd(a, b)

# 1 2 3
# a, b, c = LI()


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))

# a = I()


def I(): return int(sys.stdin.buffer.readline())

# abc def
# a, b = LS()


def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()

# a = S()


def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')

# 2
# 1
# 2
# [1, 2]


def IR(n): return [I() for i in range(n)]

# 2
# 1 2 3
# 4 5 6
# [[1,2,3], [4,5,6]]


def LIR(n): return [LI() for i in range(n)]

# 2
# abc
# def
# [abc, def]


def SR(n): return [S() for i in range(n)]

# 2
# abc def
# ghi jkl
# [[abc,def], [ghi,jkl]]


def LSR(n): return [LS() for i in range(n)]

# 2
# abcd
# efgh
# [[a,b,c,d], [e,f,g,h]]


def SRL(n): return [list(S()) for i in range(n)]


def main():
    n = I()
    lst = LI()
    print(gcd(lst))


if __name__ == "__main__":
    main()


### FIXED CODE ###

from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
import sys
INF = float('inf')
mod = 10**9+7


def lcm(a, b): return a * b / gcd(a, b)

# 1 2 3
# a, b, c = LI()


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))

# a = I()


def I(): return int(sys.stdin.buffer.readline())

# abc def
# a, b = LS()


def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()

# a = S()


def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')

# 2
# 1
# 2
# [1, 2]


def IR(n): return [I() for i in range(n)]

# 2
# 1 2 3
# 4 5 6
# [[1,2,3], [4,5,6]]


def LIR(n): return [LI() for i in range(n)]

# 2
# abc
# def
# [abc, def]


def SR(n): return [S() for i in range(n)]

# 2
# abc def
# ghi jkl
# [[abc,def], [ghi,jkl]]


def LSR(n): return [LS() for i in range(n)]

# 2
# abcd
# efgh
# [[a,b,c,d], [e,f,g,h]]


def SRL(n): return [list(S()) for i in range(n)]


def main():
    n = I()
    lst = LI()
    ans = lst[0]
    for i in range(1, n):
        ans = gcd(ans, lst[i])
    print(ans)


if __name__ == "__main__":
    main()
A, B, K = map(int, input().split())

if A > B:
	tmp = B
	B = A
	A = tmp

count = 0
ans = 0

for i in range(1,A+1):
	if A % i == 1 and B & i ==1
		count += 1
		if count == K:
			ans = i
			break

print(ans)

### FIXED CODE ###

A, B, K = map(int, input().split())
#A, B, K = 12, 8, 2


if A > B:
	tmp = B
	B = A
	A = tmp
	#print(A,B)

d = []

for i in range(1,A+1):
	if A % i == 0 and B % i == 0:
		d.append(i)

d.reverse()
print(d[K-1])