Harryxun/stf_run huggingface dataset:
#!/usr/bin/env python
import itertools

def main():
    N = int(input())
    p = list(map(int, input().split()))

    compArr = list(range(1, N+1))
    arr = list(range(N))
    combs = list(itertools.combinations(arr, 2))

    ans = 'NO' 
    if p == compArr:
        ans = 'YES'
    for c in combs:
        tmpArr = compArr.copy()
        tmpArr[c[0]], tmpArr[c[1]] = tmpArr[c[1]], tmpArr[c[0]]
        if p == tmpArr:
            ans = 'YES'

    return ans

if __name__ == '__main__':
    print(main())


### FIXED CODE ###

#!/usr/bin/env python
import itertools

def main():
    N = int(input())
    p = list(map(int, input().split()))

    compArr = list(range(1, N+1))
    arr = list(range(N))
    combs = list(itertools.combinations(arr, 2))

    ans = 'NO' 
    if p == compArr:
        ans = 'YES'
    for c in combs:
        tmpArr = compArr.copy()
        tmpArr[c[0]], tmpArr[c[1]] = tmpArr[c[1]], tmpArr[c[0]]
        if p == tmpArr:
            ans = 'YES'

    return ans

if __name__ == '__main__':
    print(main())
a,b=map(int,input().split())↲
d=0
c=a*3
if c>=1:
  d=(c+b)//2
elif c==0 and b>1:
  d=b//2
print(d)↲


### FIXED CODE ###

a, p = map(int, input().split())
#print (int((a*3 + p) / 2))
#a,p=map(int,input().split())↲
print(int((a*3+p)/2))
N, X = map(int, input().split())
L_list = list(map(int, input().split()))
D = 0
ans = 0
for i in range(N+1):
    if D > X:
        break
    else:
        D += L_list[i]
        ans += 1
print(ans)

### FIXED CODE ###

N, X = map(int, input().split())
L_list = list(map(int, input().split()))
D = 0
ans = 1
for i in range(N):
    D += L_list[i]
    if D > X:
        break
    else:
        ans += 1
print(ans)
# input
S = input()

ans = 0

for i in range(3):
    if S[i] == o:
        ans += 1

print(ans)

### FIXED CODE ###

# input
S = input()

ans = 0

for i in range(3):
    if S[i] == 'o':
        ans += 1

ans = ans * 100 + 700

print(ans)
from collections import Counter

N = int(input())

p = []
for _ in range(N):
    p.append(tuple(map(int, input().split())))

d = []
for i, p1 in enumerate(p):
    for j, p2 in enumerate(p):
        if i == j:
            continue
        x = p1[0] - p2[0]
        y = p1[1] - p2[1]
        d.append((x, y))

c = Counter(d)
# print(c)
print(N - c.most_common()[0][1])


### FIXED CODE ###

from collections import defaultdict
from operator import itemgetter

N = int(input())
p = []
for _ in range(N):
    p.append(tuple(map(int, input().split())))
p.sort(key=itemgetter(0), reverse=True)

if N == 1:
    print(1)
else:
    d = defaultdict(int)
    for i, pp1 in enumerate(p):
        for j in range(i + 1, N):
            pp2 = p[j]
            d[(pp1[0] - pp2[0], pp1[1] - pp2[1])] += 1
        # print(d)

    cnt = 0
    keys = tuple(d.keys())
    for k in keys:
        x, y = k
        cnt = max(cnt, d[k] + d[(-x, -y)])

    print(N - cnt)
n,k=list(map(int,input().split(" ")))
s=list(input())
s_str=""
s[k-1]=s[k-2].lower()
for i in s:
  s_str +=s[i]
print(s_str)

### FIXED CODE ###

n,k=list(map(int,input().split(" ")))
s=list(input())
s_str = ""
if s[k-1]=="A":
    s[k-1]="a"
elif s[k-1]=="B":
    s[k-1]="b"
else:
    s[k-1]="c"
for i in s:
    s_str += i
print(s_str)
h, w, n = map(int, input().split())

ps = [[] for i in range(h)]
blocks = set()
for i in range(n):
    x, y = map(lambda x: int(x)-1, input().split())
    # if x < y:
    #     continue
    ps[y].append(x)
    blocks.add((x, y))
y_app_x = [[w+1] for i in range(h)]
x, y = (0, 0)
cands = [w]
while y < h:
    if (x+1, y) in blocks:
        # 高橋君は移動できなければ = 障害物に移動すると即死
        cands.append(x+1)
        break
    else:
        ps[y] = [p for p in ps[y] if p > x]
        if ps[y]:
            cands.append(min(ps[y]))
        x += 1
        while (x, y+1) in blocks and x < w:
            x += 1

    y += 1
print(min(cands))


### FIXED CODE ###

w,h, n = map(int, input().split())

ps = [[] for i in range(h)]
blocks = set()
for i in range(n):
    x, y = map(lambda x: int(x)-1, input().split())
    # if x < y:
    #     continue
    ps[y].append(x)
    blocks.add((x, y))
x, y = (0, 0)
cands = [w]
while y < h:
    if (x+1, y) in blocks:
        # 高橋君は移動できなければ = 障害物に移動すると即死
        cands.append(x+1)
        break
    else:
        x += 1
        ps[y] = [p for p in ps[y] if p > x]
        if ps[y]:
            cands.append(min(ps[y]))
        while (x, y+1) in blocks and (x+1, y) not in blocks and x+1 < w:
            x += 1
    
    if (x, y+1) in blocks:
        break
    y += 1
print(min(cands))
n, d = list(map(int, input().strip()))
cnt = 0
d2 = d**2
for i in range(n):
	x, y = list(map(int, input().strip()))
	if(x**2 + y**2 <= d2):
		cnt += 1
print(cnt)


### FIXED CODE ###

n, d = list(map(int, input().split()))
cnt = 0
d2 = d**2
x, y = [], []
for i in range(n):
	tx, ty = list(map(int, input().split()))
	x.append(tx)
	y.append(ty)

for i in range(n):
	if(x[i]**2 + y[i]**2 <= d2):
		cnt += 1
print(cnt)
x, y, z = input(map(int,split())
print(x/(y+z))

### FIXED CODE ###

x,y,z=map(int,input().split())
print((x-z)//(y+z))
i = []

try:
    while True:
        s = input()
        if s == '':
            break
        i.append(s)

except EOFError:
    pass

for s in i:

 list= [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
 print(list[s-1])

### FIXED CODE ###

i = int(input())
list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(list[i-1])
H, N = map(int, input().split())
A= [0] * N
for i in range(N):
    A[i]= map(int, input().split())
 
if sum(A[i])>H:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

H,N = map(int,input().split())
A = list(map(int, input().split()))
if sum(A)>=H:
    print("Yes")
else:
    print("No")
d,g = map(int,input().split())
"""
PC = []
for i in range(d):
    pc = list(map(int,input().split()))
    PC.append(pc)
"""
PC =[list(map(int,input().split())) for i in range(d)]

def solve(g,i):
    if i<=0:
        return float('inf')
    n = min(int(G/100*i),PC[i-1][0])
    score = 100 * i * n 
    if n == PC[i-1][0]:
        score += PC[i-1][1]
    if g > score:
        n += solve(g-score,i-1)
    return min(n,solve(g,i-1))

print(solve(g,d))

### FIXED CODE ###

d,g = map(int,input().split())
"""
PC = []
for i in range(d):
    pc = list(map(int,input().split()))
    PC.append(pc)
"""
PC =[list(map(int,input().split())) for i in range(d)]

def solve(g,i):
    if i<=0:
        return float('inf')
    n = min(int(g/(100*i)),PC[i-1][0])
    score = 100 * i * n
    if n == PC[i-1][0]:
        score += PC[i-1][1]
    if g > score:
        n += solve(g-score,i-1)
    return min(n,solve(g,i-1))

print(solve(g,d))
N = int(input())
R = sorted([list(map(int, input().split())) for i in range(N)])
T = []
for i in range(N):
    T.append([R[i][0] + R[i][1], i])
T.sort()

while len(T) - 1 > 0:
    t = T.pop(0)
    print(t[0], R[t[1] + 1][0], R[t[1] + 1][1])
    if t[0] > R[t[1] + 1][0] - R[t[1] + 1][1]:
        N -= 1
        R[t[1] + 1][1] = 0
        T.pop(0)
print(N)

### FIXED CODE ###

N = int(input())
X = [list(map(int, input().split())) for i in range(N)]
LR = [[x[0]-x[1], x[0] + x[1]] for x in X]
LR.sort(key=lambda x:x[1])

A = 1
right = LR[0][1]
for i in range(1, N):
    if right <= LR[i][0]:
        A += 1
        right = LR[i][1]
print(A)
i=0
while True:
    i+=1
    x=raw_input()
    if x=='0':
        break
    print 'Case %d: %s' % (i,x)

### FIXED CODE ###

 

import sys
for i,ws in enumerate(sys.stdin, 1):
    w = ws[:-1]
    if w =='0': break
    print 'Case %d: %s' % (i, w)
a = int(input())
b = int(input())
print(a * b)

### FIXED CODE ###

a = input().split()
print(int(a[0]) * int(a[1]))
A, B = input().split()
print(A*B//1)

### FIXED CODE ###

A, B = input().split()
B = int(B[0]+B[-2]+B[-1])
A = int(A)
ans = A*B
print(ans//100)
a,b,c,d,e,f=(int(i) for i in input().split())
w,s,num=set(),set(),0
ans=[0,0]
max_salt=int(e*f/((100+e)*1.0))
for i in range(((f-f%(a*100))//(a*100))+1):#//は切り捨て除算
    #Aの何倍が最適かを網羅的に走査
    for j in range(((f-f%(b*100))//(b*100))+1):
        if i*a*100+j*b*100<=f:
            w.add(i*a*100+j*b*100)
        else:
            break
for i in range((max_salt-max_salt%c)//c+1):
    for j in range((max_salt-max_salt%d)//d+1):
        if i*c+j*d<=max_salt:
            s.add(i*c+j*d)
        else:break

w2,s2=sorted(list(w)),sorted(list(s))
for i in w2:
    for j in s2:
        if 0<i+j<=f and e*i-100*j>=0 and (i+j)*num<j:
            num=j/((i+j)*1.0)
            ans[0]=i
            ans[1]=j
print(sum(ans),ans[1])

### FIXED CODE ###

N=int(input())
A=int(input())
print(N*N-A)
money = input()
a  = money % 1000
change = 0
if a > 0:
  change = 1000 - a
else:
  change = 0
return change
print(change)

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sun Jul  5 20:25:04 2020

@author: KevinLU
"""
money = int(input())

a  = money % 1000
if a > 0:
    change = 1000 - a
else:
    change = 0
print(change)
ans=a
c=a
if a==b :
  ans=a**b
else:
  while c<=b:
    c=c+1
    ans=ans*c
pm = numpy.sign(ans)
if pm==0:
  print('zero')
elif pm==1:
  print('Positive')
else:
  print('Negative')

### FIXED CODE ###

import numpy
a,b = map(int,input().split())

if numpy.sign(a*b)==-1:
  print('Zero')
elif (numpy.sign(a)==1) or (numpy.sign(b)==1):
  print('Positive')
elif (a-b)%2==0:
  print('Negative')
else:
  print('Positive')
N = int(input())

A = []

for i in range(N-1):
    A.append(int(input()))

B = []

for j in range(N-1):
    temp = 0
    for i in A:
        if i-2 == j:
            temp += 1
    B.append(temp)        
for j in range(N-1):
    print(B[j])

### FIXED CODE ###

import collections

N = int(input())

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

c = collections.Counter(A)

for i in range(1, N+1):
    print(c[i])
N,X=map(int,input().split())
a=[]
for i in range(N):
	a.append(list(map(int,input().split())))
n=0
d=0
while n<=N:
	if d>X:
		break
	else:
		d=d+a[n]
		n=n+1

print(n+1)

### FIXED CODE ###

N,X=map(int,input().split())
L=list(map(int,input().split()))
count=0
length=0
while length<=X:
	count=count+1
	if count==N+1:
		break
	length=length+L[count-1]
print(count)
import math 
x = int(input())
xi = math.floor(x/5.5)
print(xi)
for i in range(xi,100000000000000):
    print(6*i - math.floor(i/2))
    if(x < 6*i-math.floor(i/2)):
        xa = i
        break

print(xa)


### FIXED CODE ###

import math 
x = int(input())
# x = 10**15
xi = math.floor(x/5.5)
# print(xi)
for i in range(xi,10000000000000000000000000000):
    # print(6*i - math.floor(i/2))
    if(x <= 6*i-math.floor(i/2)):
        xa = i
        break

print(xa)
from collections import deque

N = int(input_[0])
A = list(map(int,input_[1].split()))

ans=[]

A_dict={}

for n in range(N):
    a = A.popleft()
    A_dict[a]=n+1
    
for n in range(N):
    ans.append(A_dict[n+1])

print(*ans, sep=' ')

### FIXED CODE ###

from collections import deque

N = int(input())
A = deque(map(int,input().split()))

ans=[]

A_dict={}

for n in range(N):
    a = A.popleft()
    A_dict[a]=n+1
    
for n in range(N):
    ans.append(A_dict[n+1])

print(*ans, sep=' ')
import math
from functools import reduce


def main():

    N = int(input())
    A = [int(a) for a in input().split()]

    maxd = 1
    for n in range(N):
        l = A[:n] + A[n+1:]
        maxd = max(maxd, gcd(*l))

    print(maxd)    


def gcd(*numbers):
    return reduce(math.gcd, numbers)


main()


### FIXED CODE ###

import fractions
from functools import reduce


def main():

    N = int(input())
    A = [int(a) for a in input().split()]

    gcds_r = [1] * N
    gcds_r[0] = A[0]
    for n in range(1, N):
        gcds_r[n] = fractions.gcd(gcds_r[n-1], A[n])

    gcds_l = [1] * N
    gcds_l[-1] = A[-1]
    for n in range(N-1)[::-1]:
        gcds_l[n] = fractions.gcd(gcds_l[n+1], A[n])

    max_gcd = 1
    for n in range(1, N-1):
        max_gcd = max(max_gcd, fractions.gcd(gcds_r[n-1], gcds_l[n+1]))

    max_gcd = max(max_gcd, gcds_l[1], gcds_r[N-2])

    print(max_gcd)  


main()
attend, rate = input()

if int(attend) >= 10:
  print(rate)
else:
  print(int(rate) - 100 * (10 - int(attend)))


### FIXED CODE ###

attend, rate = input().split(' ')
 
if int(attend) >= 10:
  print(rate)
else:
  print(int(rate) + 100 * (10 - int(attend)))
a=int(input())
print(a+a*a+a*a*a)

### FIXED CODE ###

s=list(input())
t=list(input())
ans=0
for i in range(len(s)):
    if s[i]!=t[i]:
        ans+=1
print(ans)
strlist = input().rstrip().split("")
evenset = set()
oddset = set()
 
for i in range(len(strlist)):
  if i % 2 == 0:
    oddset.add(strlist[i])
  else:
    evenset.add(strlist[i])
 
if (oddset <= {"R", "U", "D"} and evenset <= {"L", "U", "D"}):
  print("Yes")
 
else:
  print("No")

### FIXED CODE ###

moji = input().rstrip()
mojilist = list(moji)
evenset = set()
oddset = set()

for i in range(len(mojilist)):
  if i % 2 == 0:
    oddset.add(mojilist[i])
  else:
    evenset.add(mojilist[i])

if ((oddset <= {"R","U","D"}) and (evenset <= {"L","U","D"})):
  print("Yes")
else:
  print("No")
pritn(int(input())**2)

### FIXED CODE ###

print(int(input())**2)
n=list(input())
k=int(input())
if len(n)==1:
  print('1')
else:
  one_list=[]
  while len(n)!=0:
    if n[0]=='1':
      one_list.pop(n.pop(0))
    else:
      break
  if 0<len(one_list)<=k:
    print('1')
  else:
    print(n[0])

### FIXED CODE ###

n=list(input())
k=int(input())
if len(n)==1 and n[0]=='1':
  print('1')
else:
  one_list=[]
  while len(n)!=0:
    if n[0]=='1':
      one_list.append(n.pop(0))
    else:
      break
  if k<=len(one_list):
    print('1')
  else:
    print(n[0])
n=int(input())
    boss=[int(x) for x in input().split()]
    mem=list(range(1, n+1))
    h_map = dict.fromkeys(mem, 0)
    for i in boss:
      h_map[i]+=1
    for i in mem:
      print(h_map[i])

### FIXED CODE ###

n=int(input())
boss=[int(x) for x in input().split()]
mem=list(range(1, n+1))
h_map = dict.fromkeys(mem, 0)
for i in boss:
    h_map[i]+=1

for i in mem:
    print(h_map[i])
import numpy as np
N,M = map(int,input().split())
R = [[] for _ in range(N)]
ans = np.zeros(N,dtype=int)
ans[0] = 1
queue = [1]
for _ in range(M):
    i,j = map(int,input().split())
    R[i-1].append(j)
    R[j-1].append(i)
    
def bfs(que):
    if que==[]:
        return
    i = que[0]
    for j in R[i-1]:
        if ans[j-1]==0:
            ans[j-1]=i
            que.append(j)
    que.pop(0)
    bfs(que)
    
bfs(queue)
if len(ans[ans==0])>0:
    print('No')
else:
    print('Yes')
    for i in range(1,N):
        print(ans[i])

### FIXED CODE ###

import numpy as np
import sys
sys.setrecursionlimit(10**7)
N,M = map(int,input().split())
R = [[] for _ in range(N)]
ans = np.zeros(N,dtype=int)
ans[0] = 1
queue = [1]
for _ in range(M):
    i,j = map(int,input().split())
    R[i-1].append(j)
    R[j-1].append(i)
    
def bfs(que):
    if que==[]:
        return
    i = que[0]
    for j in R[i-1]:
        if ans[j-1]==0:
            ans[j-1]=i
            que.append(j)
    que.pop(0)
    bfs(que)
    
bfs(queue)
print('Yes')
for i in range(1,N):
    print(ans[i])
n,k=map(int,input().split())
import math as m
def c(t,r):
    return (m.factorial(t)//(m.factorial(t-r)*m.factorial(r)))%(10**9+7)
for i in range(1,k+1):
  a=c(k-1,i-1)
  b=c(n-k+1,i)
  print((a*b)%(10**9+7))

### FIXED CODE ###

n,k=map(int,input().split())
import math as m
def c(t,r):
    if t>=r:
      return (m.factorial(t)//(m.factorial(t-r)*m.factorial(r)))%(10**9+7)
    else:
      return 0
for i in range(1,k+1):
  a=c(k-1,i-1)
  b=c(n-k+1,i)
  print((a*b)%(10**9+7))
W, H, x, y = map(int, input().split())

# print(W, H, x, y)

multi = 0

# print(x / W, y / H)

if x / W == y / H:
    multi = 1
elif x / W <= y / H:
    S = x * H
elif x / W >= y / H:
    S = W * y

print(S, multi)


### FIXED CODE ###

W, H, x, y = map(int, input().split())

S = W * H / 2
multi = 2 * x == W and 2 * y == H

print(S, int(multi))
import collections
N=int(input())
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ASN=0
for i in A_dict.keys():
    ANS+=i**A_dict[i]

if ANS>10**18:
    print(-1)
else:
    print(ANS)

### FIXED CODE ###

import collections
import sys

N=int(input())
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ANS=1
if 0 in A_dict.keys():
    print("0")
    sys.exit()
    
for key, value in A_dict.items():
    ANS=ANS*(key**value)
    if ANS>10**18:
        print(-1)
        sys.exit()

print(ANS)
from math import pi
r = int(input())
print("{:.6f} {:.6f}".format((r*r*pi), (2*r*pi)))

### FIXED CODE ###

from math import pi
r = float(input())
print("{0:.6f} {1:.6f}".format(float(r*r*pi), float(2*r*pi)))
i=input
n=int(i())
a=eval('eval("list(map(int,i().split())),"*int(i())),'*n)
print(max(all(all(y==i>>x-1&1for x,y in t)for j,t in enumerate(a)if i>>j&1)*bin(i).count('1')for i in range(2**n)))

### FIXED CODE ###

n=int(input())
a=[[list(map(int,input().split()))for _ in'_'*int(input())]for _ in'_'*n]
m=0
for i in range(2**n):
  *s,=map(int,bin(i)[2:].zfill(n))
  f=1
  for j,t in enumerate(a):
    if s[~j]:
      for x,y in t:f&=s[-x]==y
  m=max(m,sum(s)*f)
print(m)
input R, G
output (2 * G – R)

### FIXED CODE ###

R = int(input())
G = int(input())
print(2*G-R)
column = list(map(int, input().split(" ")))
N, D = column[0], column[1]
count = 0
for i in range(1, N+1):
  X, Y=column[2*i], column[2*i+1]
  if X^2 + Y^2 <= D^2:
    count += 1
print(count)

### FIXED CODE ###

X =int(input())
if X >= 30:
	print("Yes")
else:
	print("No")
s=input()
 
count = 0 
if s[0] == 1:
    count += '1'
elif s[1] == 1:
    count += '1'
elif s[2] == 1:
    count += '1'
else:
    count = 0
    print(count('1')

### FIXED CODE ###

s = input()
count = 0 
if s[0] == '1':
    count += 1
if s[1] == '1':
    count += 1
if s[2] == '1':
    count += 1
print(count)
x = map(int,input().split())
for i in range(len(x)):
  if x[i] == 0:
    print(i+1)
    

### FIXED CODE ###

x = list(map(int,input().split()))
for i in range(len(x)):
  if x[i] == 0:
    print(i+1)
a,b = int(input().split(" "))
if a+b==15:
  print("+")
else if a*b==15:
  print("*")
else:
  print("x")


### FIXED CODE ###

a,b = map(int,input().split(" "))
if a+b==15:
  print("+")
elif a*b==15:
  print("*")
else:
  print("x")
N = int(input())
S = input()
_min = -1
for i in range(N):
    left_str = S[:i]
    right_str = S[i+1:]
    left = count('W', left_str)
    right = count('E', right_str)
    total = left + right
    if _min == -1:
        _min = total
    elif total < _min:
        _min = total
print(_min)
def count(item, str):
    counter = 0
    for c in str:
        if c == item:
            counter += 1
    return counter
        

### FIXED CODE ###

N = int(input())
S = input()
w_count = 0
e_count = 0
w_counts = [0 for _ in range(N)]
e_counts = [0 for _ in range(N)]
for i in range(N):
    if S[i] == 'W':
        w_count += 1
    w_counts[i] = w_count
for i in range(N-1, -1, -1):
    if S[i] == 'E':
        e_count += 1
    e_counts[i] = e_count
_min = -1
for i in range(N):
    total = w_counts[i] + e_counts[i]
    if _min == -1:
        _min = total
    if _min > total:
        _min = total
print(_min-1)
mod=10**9+7
n,m=map(int,input().split())
A=[int(input()) for _ in range(m)]
A=list(set(A))
A.sort()
DP=[0]*(n+1)
DP[0]=1
if A:
    j=0
    if A[0]!=1:
        DP[1]=1
    else:
        j+=1
    for i in range(2,n+1):
        if i==A[j]:
            if j<len(A)-1:
                j+=1
        else:
            DP[i]=DP[i-1]+DP[i-2]
            DP[i]%=mod
    print(DP[-1])
else:
    DP[1]=1
    for i in range(2,n+1):
        DP[i]=DP[i-1]+DP[i-2]
        DP[i]%=mod
    print(DP[-1])

### FIXED CODE ###

mod=10**9+7
n,m=map(int,input().split())
A=[int(input()) for _ in range(m)]
A=list(set(A))
A.sort()
DP=[0]*(n+1)
DP[0]=1
if A:
    j=0
    if A[0]!=1:
        DP[1]=1
    else:
        if j<len(A)-1:
            j+=1
    for i in range(2,n+1):
        if i==A[j]:
            if j<len(A)-1:
                j+=1
        else:
            DP[i]=DP[i-1]+DP[i-2]
            DP[i]%=mod
    print(DP[-1])
else:
    DP[1]=1
    for i in range(2,n+1):
        DP[i]=DP[i-1]+DP[i-2]
        DP[i]%=mod
    print(DP[-1])
H, W = map(int, input().split())
field = []
for i in range(H):
    field.append(list(map(int, input().split())))

tmp = []
cnt = 0 
for i in range(H):
    if i % 2 == 0:
        for j in range(W):
            if j == W-1 and field[i][j] % 2 == 1:
                field[i][j] -= 1
                filed[i+1][j] += 1
                tmp.append(list((j, i, j, i+1)))
                cnt += 1
            elif field[i][j] % 2 == 1:
                field[i][j] -= 1
                field[i][j+1] += 1
                tmp.append(list((j, i, j+1, i)))
                cnt += 1
    else:
        for j in range(W)[::-1]:
            if j == 0 and field[i][j] % 2 == 1:
                field[i][j] -= 1
                field[i+1][j] += 1
                tmp.append(list((j, i, j, i+1)))
                cnt += 1
            elif field[i][j] % 2 == 1:
                field[i][j] -= 1
                field[i][j-1] += 1
                tmp.append(list((j, i, j-1, i)))
                cnt += 1

print(cnt)
for i in range(cnt):
    print(tmp[i])

### FIXED CODE ###

H, W = map(int, input().split())
a = [list(map(int, input().split())) for i in range(H)]

ans = []

for i in range(H-1):
    for j in range(W):
        if a[i][j] % 2:
            a[i][j] -= 1
            a[i+1][j] += 1
            ans.append((i+1, j+1, i+2, j+1))

for i in range(W-1):
    if a[-1][i] % 2:
        a[-1][i] -= 1
        a[-1][i+1] += 1
        ans.append((H, i+1, H, i+2))

print(len(ans))
for row in ans:
    print(*row)
data = input(split())
A = int(data[0])
B = int(data[1])

if A < 10 and B < 10:
  print(str(A * B))
else:
  print('-1')

### FIXED CODE ###

data = input().split()
A = int(data[0])
B = int(data[1])

if A < 10 and B < 10:
  print(str(A * B))
else:
  print('-1')
# ==================== gcd   最大公約数
#from fractions import gcd
from math import gcd

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

l=[0]*(n+1)
r=[0]*(n+1)

for i in range(n):
    l[i+1]=gcd(l[i],a[i])
    r[n-i-1]=gcd(r[n-i],a[n-i-1])

mimax=1
for i in range(n):
    mi=gcd(l[i],r[i+1])
    mimax=max(mi,mimax)
   
print(mimax)

### FIXED CODE ###

def gcdf(a):
    a.sort()
#    print("a2:",a)
    a0=a[0]
    a=[int(x%a0) for x in a if x%a0 != 0]
#    print("a2:",a)
    if len(a)==0:
        return a0
    else:
        a.append(a0)
        a0=min(a)
        return gcdf(a) 

#n=8
#a=[746130, 1385670, 4849845, 881790, 3233230, 1939938, 570570, 510510]
#ans=[19]
#n=2
#a=[1000000000, 1000000000]
#n=5
#a=[15, 18, 24, 36, 81]
#n=3
#a=[7, 6, 8]
n=int(input())
a=[]
for i in map(int,input().split()):
    a.append(i)
if n==2:
    print(max(a))
elif n<2**10:
    gcdv=0
    for i in range(n):
        acpy=list(a)
        del acpy[i]
        gcdx=gcdf(acpy)
        if gcdx>gcdv:
            gcdv=gcdx
    print(gcdv)
else:
    m=int(n**(1/2))
    ns=int(n/m)
    rgcd=[]
    for mi in range(m):
        ms=ns*mi
        if mi==m-1:
            am=a[ms:n]
        else:
            am=a[ms:ms+ns]
        gcdm=gcdf(am)
        rgcd.append(gcdm)
    gcdv=0

    for mi in range(m):
        rgcd1=list(rgcd)
        del rgcd1[mi]
        gcdrg1=gcdf(rgcd1)
        ms=ns*mi
        if mi==m-1:
            am=a[ms:n]
        else:
            am=a[ms:ms+ns]
#        print(mi,gcdf(am),len(am),gcdf(rgcd1))
        for i in range(len(am)):
            acpy=list(am)
#            del acpy[i]
#            acpy.append(gcdrg1)
            acpy[i]=gcdrg1
            gcdx=gcdf(acpy)
            if gcdx>gcdv:
                gcdv=gcdx
    print(gcdv)