Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

# -*- coding: utf-8 -*-
import math
 
def Strider():
 
    NumA = int(input())
 
    X = 0
    Y = 0

    X_move = 0
    Y_move = 1
    
    count = 1
    kakudo = NumA
    
    while (X!=X_move or Y != Y_move):
        kakudo = kakudo + NumA
        
        X_move = X_move + round(math.cos(math.radians(kakudo)), 3)
        Y_move = Y_move + round(math.sin(math.radians(kakudo)), 3)
        count = count + 1    
    
    print(count)
 
if __name__ == '__main__':
    Strider()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import math
 
def Strider():
 
    NumA = int(input())
 
    count = 360/NumA
    
    NumB = 1
    
    while ((360*NumB % NumA) != 0):
        NumB = NumB + 1
        count = 360*NumB/NumA
    
    print(int(count))
 
if __name__ == '__main__':
    Strider()
### BUGGY CODE ###

N=int(input())
A=list(map(int,input().split()))
A.sort()
B=list(map(int,input().split()))
B.sort()
C=list(map(int,input().split()))
C.sort()
from bisect import bisect_right
ret=0

Cb=[0]*N
for i in range(N):
  Cb[i]=N-bisect_right(C,B[i])
for a in A:
  bi=bisect_right(B,a)
  for bii in range(bi,N):
    ret+=Cb[bii]
print(ret)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
B.sort()
C=list(map(int,input().split()))
C.sort()
from bisect import bisect_right
ret=0
Cb=[0]*(N+1)
for i in range(N):
  Cb[i]=N-bisect_right(C,B[i])
for i in range(N-1,-1,-1):
  Cb[i]+=Cb[i+1]
for a in A:
  bi=bisect_right(B,a)
  ret+=Cb[bi]
print(ret)
### BUGGY CODE ###

R,C,K = map(int,input().split())
mat = [ [0]*C for _ in range(R) ]
for _ in range(K):
  r,c,v = map(int,input().split())
  mat[r-1][c-1] = v

# dp[i][j][k] = i,jまでで、i列のものをk個取ったときのスコア
dp = [ [ [0]*4 for _ in range(C+1)] for _ in range(R+1) ]

for i in range(1,R+1):
  for j in range(1,C+1):
    m = mat[i-1][j-1]
    # 左からの遷移
    for k in range(1, 4):
      dp[i][j][k] = max(dp[i][j-1][k], dp[i][j-1][k-1]+m)

    # 上からの遷移
    x = max(dp[i-1][j])
    dp[i][j][0] = max(dp[i][j-1][0], x)
    dp[i][j][1] = max(dp[i][j][1], x+m)

print(max(dp[R][C]))

### FIXED CODE ###

R,C,K = map(int,input().split())
mat = {}
for _ in range(K):
  r,c,v = map(int,input().split())
  mat[(r,c)] = v

# dp[i][j][k] = i,jまでで、i列のものをk個取ったときのスコア
dp0 = [[0] * (C+1) for _ in range(R+1) ]
dp1 = [[0] * (C+1) for _ in range(R+1) ]
dp2 = [[0] * (C+1) for _ in range(R+1) ]
dp3 = [[0] * (C+1) for _ in range(R+1) ]

for i in range(1,R+1):
  for j in range(1,C+1):
    if (i,j) in mat:
      m = mat[(i,j)]
      # 左からの遷移
      dp1[i][j] = max(dp1[i][j-1], dp0[i][j-1]+m)
      dp2[i][j] = max(dp2[i][j-1], dp1[i][j-1]+m)
      dp3[i][j] = max(dp3[i][j-1], dp2[i][j-1]+m)
    else:
      dp1[i][j] = dp1[i][j-1]
      dp2[i][j] = dp2[i][j-1]
      dp3[i][j] = dp3[i][j-1]

    # 上からの遷移
    x = max(dp0[i-1][j], dp1[i-1][j], dp2[i-1][j], dp3[i-1][j])
    dp0[i][j] = max(dp0[i][j-1], x)
    if (i,j) in mat:
      m = mat[(i,j)]
      dp1[i][j] = max(dp1[i][j], x+m)
    else:
      dp1[i][j] = max(dp1[i][j], x)

print(max(dp0[R][C], dp1[R][C], dp2[R][C], dp3[R][C]))
### BUGGY CODE ###

n, m, k = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))

C = [0]
D = [0]
for a in A:
    C.append(C[-1] + a)
for b in B:
    D.append(D[-1] + b)

for i in range(n + 1):
    if C[i] > k:
        p = i - 1
        break
    p = n

_max = 0
for i in range(p, -1, -1):
    for j in range(m + 1):
        if C[i] + D[j] > k:
            break
        elif _max < i + j:
            _max = i + j
print(_max)

### FIXED CODE ###

n, m, k = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))

C = [0]
D = [0]
for a in A:
    C.append(C[-1] + a)
for b in B:
    D.append(D[-1] + b)

p = n
for i in range(n + 1):
    if C[i] > k:
        p = i - 1
        break

_max = p
keep = 0
for i in range(p, -1, -1):
    for j in range(keep, m + 1):
        if C[i] + D[j] > k:
            keep = j - 1
            break
        elif _max < i + j:
            _max = i + j
    if j == m:
        break
print(_max)
### BUGGY CODE ###

import bisect,copy,heapq,itertools,math,string
from collections import *
import sys
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
a = LIST()
b = [i for i in range(n)]

for i in range(n):
    b.remove(i)
    b.append(i)
    b.reverse()

c = [a[b[i]] for i in range(n)]
print(*c)

### FIXED CODE ###

import bisect,copy,heapq,itertools,math,string
from collections import *
import sys
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
a = LIST()
b = deque()

for i in range(n):
    if(i%2==0):
        b.append(i)
    else:
        b.appendleft(i)

if(n%2==1):
    b.reverse()

c = [a[b[i]] for i in range(n)]
print(*c)
### BUGGY CODE ###

n = int(input())
s = []
for i in range(n):
    s.append(sorted(list(input())))
cnt_ans = 0
while len(s):
    remove_list = []
    cnt = 0
    for i in range(1, len(s)):
        if s[0] == s[i]:
            cnt += 1
            remove_list.append(s[i])
    cnt = int((cnt+1) * (cnt) / 2)
    cnt_ans += cnt
    remove_list.append(s[0])
    for lst in remove_list:
        s.remove(lst)
print(cnt_ans)

### FIXED CODE ###

n = int(input())
s = []
for i in range(n):
    s.append(sorted(list(input())))
cnt_ans = 0
s.sort()
cnt = 0
left = 0
right = 1
while right <= n-1:
    if s[left] == s[right]:
        right += 1
        cnt += 1
    else:
        left, right = right, right+1
        cnt_ans += ((cnt+1)*cnt//2)
        cnt = 0
    if right == n:
        cnt_ans += ((cnt+1)*cnt//2)
print(cnt_ans)
### BUGGY CODE ###

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

ans = 0
while True:
  if all(i%2==1 for i in a): break
  ans += 1
  t = 0
  for i in range(n):
    if a[i]%2 == 1: a[i] *= 3
    else:
      if t == 0 and a[i] != 2:
        a[i] //= 2
        t += 1
      else: a[i] *= 3

print(ans)

### FIXED CODE ###

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

ans = 0
for i in a:
  while i%2==0:
    i//=2
    ans+= 1
print(ans)
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort()
B.sort()
C.sort()
count = 0
for i in range(N):
    a = A[i]
    for j in range(N):
        if B[j] > a:
            b = B[j]
            for k in range(N):
                if C[k] > b:
                    count+=(N-k)
                    break
                else:
                    pass
print(count)

### FIXED CODE ###

#C
import bisect
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort()
B.sort()
C.sort()

bi = [0 for i in range(N)]
for i in range(N):
    b = B[i]
    c = bisect.bisect_right(C,b)
    bi[i]+=(N-c)

S = sum(bi)
rui = [0]
for bii in bi:
    rui.append(rui[-1]+bii)

rui = rui[::-1]
ans = 0
for i in range(N):
    a = A[i]
    ind = bisect.bisect_right(B,a)
    #print(ind,rui[N-ind])
    ans+=(S-rui[N-ind])

    
    
print(ans)
#print(rui)
### BUGGY CODE ###

n= int(input())
A = list(map(int, input().split()))
count = 0
for i in range(len(A)):
    isMatch = True
    for j in range(i):
        if A[j] <= A[i]:
            isMatch = False
    if(isMatch):
        count = count + 1
print(count)


### FIXED CODE ###

n= int(input())
A = list(map(int, input().split()))
count = 0
minVal = A[0]
for i in range(len(A)):
    if A[i] <= minVal:
        count = count + 1
        minVal = A[i]
print(count)
### BUGGY CODE ###

# -*- coding: utf-8 -*-

def main():
    N=int(input())  #数値入力 「N」だけの入力のとき
    H=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
    D=list()
    for i in range(1, N):
        if H[i-1] >= H[i]:
            D.append(1)
        else:
            D.append(0)
    #print("D")
    #print(D)

    ans = 0
    a = 0
    D = tuple(D)
    for i in range(len(D)):
        a = 0
        for j in range(i, len(D)):            
            if D[j] == 1:
                a += 1
                if a > ans:
                    ans = a
            else:
                if a > ans:
                    ans = a
                break
            #print("i j")
            #print(str(i) +" "+str(j) +" "+str(ans))
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

N = int(input())
H = [int(x) for x in input().split()]
ans = 0
cnt = 0
for ind,i in enumerate(H[:-1]):
    if(i>=H[ind+1]):
        cnt += 1
    else:
        cnt = 0
    ans = max(ans,cnt)
print(ans)
### BUGGY CODE ###

a, b = map(int, input().split())
ans = 1

for i in range(a, b+1):
    ans *= i
    if ans == 0:
        break

if ans > 0: print('Positive')
elif ans < 0: print('Negative')
else: print('Zero')

### FIXED CODE ###

a, b = map(int, input().split())
if a < 0 and b > 0:
    print('Zero')
elif a > 0 and b > 0:
    print('Positive')
else:
    if (a - b - 1) % 2 == 0:
        print('Positive')
    else:
        print('Negative')
### BUGGY CODE ###

N = int(input())
A = [int(input()) for i in range(N)]


left_max = [-1] * N
right_max = [0]
all = sum(A)
left_max[0] = A[0]
right_max[0] = A[-1]
for i in range(1, N):
        left_max[i] = max(left_max[i-1], A[i])
for i in reversed(range(0, N-1)):
        right_max.insert(0, max(right_max[0], A[i]))


print(right_max[1])
for i in range(1,N-1):
        print(max(left_max[i-1], right_max[i+1]))
print(left_max[-2])

### FIXED CODE ###

N = int(input())
A = [int(input()) for i in range(N)]


A_hash = {}
for i in range(N):
        if A[i] in A_hash:
                A_hash[A[i]] += 1
        else:
                A_hash[A[i]] = 1


A_max = max(A)
A_keys = list(A_hash.keys())
A_keys.sort()

if len(A_keys) > 1:
        A_second_max = A_keys[-2]
else:
        A_second_max = A_keys[-1]



for i in range(N):
        if A[i] == A_max:
                if A_hash[A_max] == 1:
                        print(A_second_max)
                else:
                        print(A_max)
        else:
                print(A_max)
### BUGGY CODE ###

L,R = map(int,input().split())
r = min(R,L+4038)
ans = 2018
for i in range(L,R+1,1):
    for j in range(i+1,R+1):
        tmp = (i*j)%2019
        ans = min(tmp,ans)
print(ans)

### FIXED CODE ###

L,R = map(int,input().split())
r = min(R,L+4038)
ans = 2018
for i in range(L,r+1,1):
    for j in range(i+1,r+1):
        tmp = (i*j)%2019
        ans = min(tmp,ans)
print(ans)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
INF = 10**10
n = int(input())
a = [int(_) - (i + 1) for i, _ in enumerate(input().split())]
a.sort()

grief = INF
for b in set(a):
    tmp = sum([abs(ai - b) for ai in a])
    if tmp < grief:
        grief = tmp

print(grief)


### FIXED CODE ###

# -*- coding: utf-8 -*-
n = int(input())
a = [int(_) - (i + 1) for i, _ in enumerate(input().split())]

# INF = 10**10
# grief = INF
# for b in set(a):
#     tmp = sum([abs(ai - b) for ai in a])
#     if tmp < grief:
#         bb = b
#         grief = tmp

# print(grief)  # running time limit error

a.sort()
med = a[len(a) // 2]
grief = sum([abs(ai - med) for ai in a])
print(grief)
### BUGGY CODE ###

n = int(input())
l = list(map(int, input().split()))
a = 1
for i in range(n):
  a *= l[i]
if a > 1000000000000000000:
  a = -1
print(a)

### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
a = 1
for i in range(n):
  if l[i] == 0:
    a = 0
if a != 0:
  for i in range(n):
    a *= l[i]
    if a > 1000000000000000000:
      a = -1
      break
print(a)
### BUGGY CODE ###

n = int(input())
arr = []

for i in range(n):
    s = input()
    arr.append(s)
    
counter = 0
dic = []

for i in set(arr):
    c = arr.count(i)
    if counter < c:
        counter = c
        dic = []
        dic.append(i)
    elif counter == c:
        dic.append(i)
    else:
        continue

dic = sorted(dic)
for i in dic:
    print(i)


### FIXED CODE ###

n = int(input())
arr = {}

for i in range(n):
    s = input()
    if not s in arr:
        arr[s] = 1
    else:
        arr[s] += 1

max_count = max(arr.values())
dic = [key[0] for key in arr.items() if key[1] == max_count]

out_sort = sorted(dic)
for i in out_sort:
    print(i)
### BUGGY CODE ###

import itertools
n,m,x = map(int, input().split())
book = []
for i in range(n):
  b = list(map(int, input().split()))
  book.append(b)

junretu = itertools.permutations(range(n))
min_nedan = 10**9
for j in junretu:
  count_list = [0]*m
  nedan = 0
  for b in j:
    naiyou = book[b]
    nedan += naiyou[0]
    for i in range(1, m+1):
      count_list[i-1] += naiyou[i]
    if min(count_list)>=x:
      break
  else:
    print(-1)
    exit()
  if nedan < min_nedan:
    min_nedan = nedan
print(min_nedan)
  


### FIXED CODE ###

import itertools
n,m,x = map(int, input().split())
book = []
for i in range(n):
  b = list(map(int, input().split()))
  book.append(b)
book = sorted(book, key=lambda x:x[0])
junretu = itertools.permutations(range(n))
max_ = 2**n
min_nedan = 10**9
for j in range(max_):
  bit = format(j, "0"+str(n)+"b")
  count_list = [0]*m
  nedan = 0
  for b in range(n):
    if bit[b] == "1":
      naiyou = book[b]
      nedan += naiyou[0]
      for i in range(1, m+1):
        count_list[i-1] += naiyou[i]
  if min(count_list)>=x:
    if nedan < min_nedan:
      min_nedan = nedan
if min_nedan == 10**9:
  print(-1)
else:
  print(min_nedan)
### BUGGY CODE ###

def find(x):
    while union[x] != x:
        x = union[x]
    return x

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

union = [i for i in range(N+1)]

for i in range(M):
    x, y = map(int, input().split())
    a, b = find(x), find(y)
    if a != b:
        union[a] = b

ans = 0
for idx, n in enumerate(p):
    x, y = find(idx+1), find(n)
    if x == y:
        ans += 1
    
print(ans)

### FIXED CODE ###

def find(x):
    while union[x] != x:
        x = union[x]
        
    return x

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

union = [i for i in range(N+1)]

for i in range(M):
    x, y = map(int, input().split())
    x = find(x)
    while union[y] != y:
        union[y], y = x, union[y]
        
    union[y] = x
    
ans = 0
for idx, n in enumerate(p):
    if idx+1 == n:
        ans += 1
    else:
        x, y = find(idx+1), find(n)
        if x == y:
            ans += 1
        
print(ans)
### BUGGY CODE ###

n = int(input())
ans = sum(range(n))
print(ans)

### FIXED CODE ###

n = int(input())
ans = n * (n-1)//2
print(ans)
### BUGGY CODE ###

n = int(input())
p = list(map(int, input().split()))
count = 0
m = [0] * n

for i in range(1, n+1):
    m[i-1] = min(p[:i])

for i in range(1, n+1):
    if p[i-1] <= m[i-1]:
        count += 1

print(count)

### FIXED CODE ###

n = int(input())
p = list(map(int, input().split()))
count = 0
m = [0] * n

memo = n
for i in range(n):
    if memo > p[i]:
        m[i] = p[i]
        memo = p[i]
    else:
        m[i] = memo

for i in range(1, n+1):
    if p[i-1] <= m[i-1]:
        count += 1

print(count)
### BUGGY CODE ###

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

for b, c in BC:
    for i in range(b):
        if A[i] < c:
            A[i] = c
        else:
            break
    A.sort()
    
print(sum(A))

### FIXED CODE ###

N, M = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
BC = sorted(
    [list(map(int, input().split())) for _ in range(M)],
    reverse=True,
    key=lambda x: x[1]
)

BClist = []
for m in range(M):
    b, c = BC[m]
    BClist.extend([c for _ in range(b)])
    if len(BClist) > N:
        break

final_list = [None]*N
i_a = 0
i_bc = 0
for n in range(N):
    if i_bc >= len(BClist):
        final_list[n] = A[i_a]
        i_a += 1
    else:
        if A[i_a] > BClist[i_bc]:
            final_list[n] = A[i_a]
            i_a += 1
        else:
            final_list[n] = BClist[i_bc]
            i_bc += 1
print(sum(final_list))
### BUGGY CODE ###

H, W, K = map(int,input().split())
S = [list(map(int,input())) for _ in range(H)]
ans = float("inf")
for i in range(1<<(H - 1)):
    data = [S[0][0:]]
    for j in range(H - 1):
        if (i >> j) & 1:
            data.append([0] * W)
        for k in range(W):
            data[-1][k] += S[j + 1][k]
    if any([any([x > K for x in y]) for y in data]):
        continue
    cnt = len(data) - 1
    judge = [0] * len(data)
    for j in range(W):
        if any([judge[x] + data[x][j] > K for x in range(len(data))]):
            judge = [0] * len(data)
            cnt += 1
        judge = [judge[x] + data[x][j] for x in range(len(data))]
    ans = min(ans, cnt)
print(ans)

### FIXED CODE ###

H, W, K = map(int,input().split())
S = [list(map(int,input())) for _ in range(H)]
ans = float("inf")
for i in range(1<<(H - 1)):
    data = [S[0][0:]]
    for j in range(H - 1):
        if (i >> j) & 1:
            data.append([0] * W)
        for k in range(W):
            data[-1][k] += S[j + 1][k]
    if any([any([x > K for x in y]) for y in data]):
        continue
    cnt = len(data) - 1
    judge = [0] * len(data)
    for j in range(W):
        if any([judge[x] + data[x][j] > K for x in range(len(data))]):
            judge = [0] * len(data)
            cnt += 1
        judge = [judge[x] + data[x][j] for x in range(len(data))]
    ans = min(ans, cnt)
print(ans)
### BUGGY CODE ###

N,K=map(int,input().split())
S=N
if K//2 !=0:
    while S>K//2:
        S=abs(S-K)
    print(S)
else:
    print(0)

### FIXED CODE ###

N,K=map(int,input().split())
S=N
if N%K==0:
    print(0)
else:
    print(min(N%K,abs(N%K-K)))
### BUGGY CODE ###

[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = []
mini = min(A[0:L])
ans.append(mini)
if max(A) > 10 ** 9 and N == 10**6: print(1)
for i in range(1,N-L+1) :
    if A[i+L-1] <= mini :
        mini = A[i+L-1]
    elif A[i-1] == mini :
        mini = min(A[i:i+L])
    ans.append(mini)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])
### BUGGY CODE ###

S = list(map(str,input()))
i = 0
ans = 0
while i < len(S)-1:
    if S[i] + S[i+1]=='BW':
        ans += 1
        S[i]='W'
        S[i+1]='B'
        if i>0:
            i -= 1
    else:
        i += 1
print(ans)


### FIXED CODE ###

S = input()
n = S.count('W')
print(sum([i for i in range(len(S)) if S[i]=='W']) - n*(n-1)//2)
### BUGGY CODE ###

S=list(map(int,list(input())))
N=len(S)

remainder=[0]*2019
s=[0]*N
for i in range(1,N+1):
  s[i-1]=S[-i]*(10**(i-1))

val=0
for i in range(N):
  val+=s[i]
  remainder[val%2019]+=1

ans=remainder[0]
for i in range(2019):
  if remainder[i]<=1:
    continue
  else:
    ans+=remainder[i]*(remainder[i]-1)//2
print(ans)

### FIXED CODE ###

S=input()
N=len(S)
M=2019

remainder=[0]*M
val=0
for i in range(N):
  val=(int(S[N-1-i])*pow(10,i,M)+val)%M
  remainder[val]+=1

ans=remainder[0]
for i in range(2019):
  ans+=remainder[i]*(remainder[i]-1)//2
print(ans)
### BUGGY CODE ###

n=int(input())
b=[]
a=list(map(int,input().split()))
for i in range(n):
    b.append(str(a.index(i+1)+1))
print(' '.join(b))

### FIXED CODE ###

n=int(input())
b=['']*n
a=list(map(int,input().split()))
for i in range(n):
    b[a[i]-1]=str(i+1)
print(' '.join(b))
### BUGGY CODE ###

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

while M != 0:
  A.sort(reverse=True)
  A[0] = A[0] // 2
  M -= 1
  
print(sum(A))

### FIXED CODE ###

import heapq
N, M = map(int, input().split())
A = [int(_)*(-1) for _ in input().split()]
heapq.heapify(A)

while M != 0:
  max_ = -heapq.heappop(A) // 2
  heapq.heappush(A, -max_)
  M -= 1
  
print(-sum(A))
### BUGGY CODE ###

n = int(input())
lst = [int(i) for i in input().split()]

if all([i % min(lst) == 0 for i in lst]):
    print(min(lst))
    exit()

gcm = 1
j = 2
lmt = int(min(lst) ** 0.5) + 1
while j <= lmt:
    if all([i % j == 0 for i in lst]):
        lst = [i / j for i in lst]
        gcm *= j
    else:
        j += 1

print(gcm)


### FIXED CODE ###

from functools import reduce

n = int(input())
lst = [int(i) for i in input().split()]


def gcd(x, y):
    while y != 0:
        x, y = y, x % y
    return x


print(reduce(gcd, lst))
### BUGGY CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n, m, q = [int(x) for x in input().split()]
abcd = [[int(x) for x in input().split()] for _ in range(q)]
all_pattern = []
start = '1'
def dfs(s):
    last_s = int(s[-1])
    next_s = [str(x) for x in range(last_s, m + 1)]
    for i in next_s:
        t = s + i
        if len(t) == n + 1:
            all_pattern.append(t[1:])
        else:
            dfs(t)
dfs(start)
ans = 0
for pattern in all_pattern:
    res = 0
    for i in range(q):
        a, b, c, d = abcd[i]
        if int(pattern[b - 1]) - int(pattern[a - 1]) == c:
            res += d
    ans = max(ans, res)
print(ans)

    





### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n, m, q = [int(x) for x in input().split()]
abcd = [[int(x) for x in input().split()] for _ in range(q)]
all_pattern = []
start = ['1']

def dfs(s):
    last_s = int(s[-1])
    next_s = [str(x) for x in range(last_s, m + 1)]
    for i in next_s:
        t = s[:]
        t.append(i)
        if len(t) == n + 1:
            all_pattern.append(t[1:])
        else:
            dfs(t)
dfs(start)
ans = 0
for pattern in all_pattern:
    res = 0
    for i in range(q):
        a, b, c, d = abcd[i]
        if int(pattern[b - 1]) - int(pattern[a - 1]) == c:
            res += d
    ans = max(ans, res)
#print(all_pattern)
print(ans)
### BUGGY CODE ###

import sys

n, m = map(int, input().split())
lst = [[] for _ in range(n+1)]
for i in range(m):
    a, b = map(int, input().split())
    lst[a].append(b)
    lst[b].append(a)

if m % 2 == 1:
    print(-1)
    sys.exit()

hen = m
while True:
    if hen == 0:
        break
    for i in range(1, n+1):
        if len(lst[i])%2 == 0 and len(lst[i]) != 0:
            x = lst[i].pop()
            y = lst[i].pop()
            lst[x].remove(i)
            lst[y].remove(i)
            print(i, x)
            print(i, y)
            hen -= 2
            break

### FIXED CODE ###

import sys

n, m = map(int, input().split())
edge = [list(map(int, input().split())) for _ in range(m)]
lst = [set() for _ in range(n+1)]
for a, b in edge:
    lst[a].add(b)
    lst[b].add(a)

if m % 2 == 1:
    print(-1)
    sys.exit()

check = [0] * (n+1)
q = [1]
next_q = []
tree = [set() for _ in range(n+1)]
top = [1]
while q:
    for oya in q:
        check[oya] = 1
        for ko in lst[oya]:
            if check[ko] == 0:
                check[ko] = 1
                top.append(ko)
                next_q.append(ko)
                tree[oya].add(ko)
                tree[ko].add(oya)
    q = next_q.copy()
    next_q = []

ecount = [0] * (n+1)
for a, b in edge:
    if a in tree[b]:
        continue
    print(a, b)
    ecount[a] += 1

for i in top[::-1][:-1]:
    j = list(tree[i])[0]
    if ecount[i]%2 == 0:
        print(j, i)
        ecount[j] += 1
    else:
        print(i, j)
        ecount[i] += 1
    tree[i].remove(j)
    tree[j].remove(i)