Harryxun/stf_run huggingface dataset:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a, b, c = LI()
    if a[-1] == b[0] and b[-1] == c[0]:
        print("YES")
    else:
        print("NO")
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()


### FIXED CODE ###

#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a, b, c = LS()
    if a[-1] == b[0] and b[-1] == c[0]:
        print("YES")
    else:
        print("NO")
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()
import sys
input = sys.stdin.readline
from collections import defaultdict


class PrimeFactor():

    def __init__(self, n):                  # エラトステネス　O(N loglog N)
        self.n = n
        self.table = list(range(n+1))
        self.table[2::2] = [2]*(n//2)
        for p in range(3, int(n**0.5) + 2, 2):
            if self.table[p] == p:
                self.table[p * p::2 * p] = [p] * ((n - p * p - 1) // (2 * p) + 1)

    def is_prime(self, x):  # 素数判定　O(1)
        if x < 2:
            return False
        return self.table[x] == x

    def prime_factors(self, x):             # 素因数分解 O(logN)
        res = []
        if x < 2:
            return res
        while self.table[x] != 1:
            res.append(self.table[x])
            x //= self.table[x]
        return res

    def prime_counter(self, x):             # 素因数分解（個数のリスト）
        res = defaultdict(int)
        if x < 2:
            return res
        while self.table[x] != 1:
            res[self.table[x]] += 1
            x //= self.table[x]
        return res

    def prime_gcd(self, X):                 # n個の最大公約数　X:n個のリスト
        exponents = self.prime_counter(X[0])
        for x in X[1:]:
            Y = self.prime_counter(x)
            for prime, exp in exponents.items():
                if Y[prime] < exp:
                    exponents[prime] = Y[prime]
        res = 1
        for prime, exp in exponents.items():
            res *= pow(prime, exp)
        return res

    def prime_lcm(self, X, mod=None):       # n個の最小公倍数　X:n個のリスト
        exponents = defaultdict(int)
        for x in X:
            for prime, exp in self.prime_counter(x).items():
                if exp > exponents[prime]:
                    exponents[prime] = exp
        res = 1
        for prime, exp in exponents.items():
            res *= pow(prime, exp, mod)
        if mod == None:
            return res
        else:
            return res % mod

mod = 10 ** 9 + 7

N = int(input())
A = list(map(int, input().split()))
A.sort()
table = PrimeFactor(A[-1])
num = table.prime_lcm(A,mod)

res = 0
for a in A:
    res += num * pow(a, mod - 2, mod)

print(res % mod)

### FIXED CODE ###

import sys
input = sys.stdin.readline
import math

def main():
    big = 10 ** 9 + 7

    N = int(input())
    A = list(map(int, input().split()))
    num = A[0]
    for i in range(1, N):
        num = num * A[i] // math.gcd(num, A[i])

    res = 0
    for a in A:
        res += num // a

    print(res % big)

if __name__ == '__main__':
    main()
import sys
import math

count = 0
judge = 0

for line in sys.stdin.readlines():
    num = int(line.strip())
    if judge == 0:
        judge = 1
    else:    
        flag = 0
        for i in range(2, math.sqrt(num) + 1):
            if num % i == 0:
                flag = 1
                break
        if flag == 0:
            count += 1

print count

### FIXED CODE ###

import sys
import math

count = 0

num_list = []

for line in sys.stdin.readlines():
    num_list.append(int(line.strip()))

num_list.remove(num_list[0])

for num in num_list:
        flag = 0
        for i in range(2, int(math.sqrt(num)) + 1):
            if num % i == 0:
                flag = 1
                break
        if flag == 0:
            count += 1

print count
import sys
input = sys.stdin.readline
N = int(input())
rbg = [0, 0, 0]
ans = 1
for a in [int(a) for a in input().strip().split()]:
    ans = (ans * rbg.count(a))
    rbg[rbg.index(a)] += 1

print(ans % (10 ** 9 + 7))

### FIXED CODE ###

import sys
input = sys.stdin.readline
N = int(input())
rbg = [0, 0, 0]
ans = 1
A = [int(a) for a in input().strip().split()]
for a in A:
    if rbg.count(a) == 0:
        print(0)
        exit()
    ans = (ans * rbg.count(a)) % (10 ** 9 + 7)
    rbg[rbg.index(a)] += 1

print(ans)
N, Q = map(int, input().split())

tree = [[] for i in range(N)]


tree_list = [0] * N
end = [0] * N

for index in range(N - 1):
    a, b = map(lambda x: int(x) - 1, input().split())
    tree[a].append(b)
    tree[b].append(a)

for index in range(Q):
    a, b = map(int, input().split())
    a -= 1
    tree_list[a] += b


def iter(node):
    end[node] = -1
    child = tree[node]
    for c in child:
        if end[c] == 0:
            tree_list[c] += tree_list[node]
            iter(c)


iter(0)

print(*tree_list)


### FIXED CODE ###

import sys

sys.setrecursionlimit(10000000)
input = sys.stdin.readline

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

tree = [[0] * 1 for i in range(N)]


tree_list = [0] * N
end = [0] * N

for index in range(N - 1):
    a, b = map(lambda x: int(x) - 1, input().split())
    tree[a].append(b)
    tree[b].append(a)

for index in range(Q):
    a, b = map(int, input().split())
    a -= 1
    tree_list[a] += b


def iter(node):
    end[node] = -1
    child = tree[node]
    for c in child:
        if end[c] == 0:
            tree_list[c] += tree_list[node]
            iter(c)


iter(0)

print(*tree_list)
def main():
    line = input().strip()
    n, m = [int(v) for line.split(' ')]

    ans_n = n * (n - 1) if n > 1 else 0
    ans_m = m * (m - 1) if m > 1 else 0
    ans = ans_n + ans_m
    return ans


if __name__ == '__main__':
    main()


### FIXED CODE ###

def tmp(n):
    return n * (n - 1) / 2


def main():
    line = input().strip()
    n, m = [int(v) for v in line.split(' ')]

    ans_n = tmp(n) if n > 1 else 0
    ans_m = tmp(m) if m > 1 else 0
    ans = ans_n + ans_m
    print(int(ans))


if __name__ == '__main__':
    main()
A=int(input()) B=float(input())
print(A*B//1)

### FIXED CODE ###

A,B=input().split()
A=int(A)
B=int(B.replace(".",""))
print(A*B//100)
N = int(input())

card = list(map(int, input().split())).sort(reverse= True)

Alice = 0
Bob = 0
for i in range(N):
  if i % 2 == 0:
    Alice += card[i]
  else:
    Bob += card[i]
    
print(Alice - Bob)

### FIXED CODE ###

N = int(input())
 
card = list(map(int, input().split()))
card.sort(reverse=True)
 
Alice = 0
Bob = 0
for i in range(N):
  if i % 2 == 0:
    Alice += card[i]
  else:
    Bob += card[i]
    
print(Alice - Bob)
import sympy
print([sympy.lucas(i) for i in range(1, int(input())+1)][-1])

### FIXED CODE ###

import functools

@functools.lru_cache()
def lucas(n):
    if n == 0:
        return 2
    if n == 1:
        return 1
    else:
        return lucas(n-1) + lucas(n-2)

N = int(input())
print([lucas(i) for i in range(1, N+1)][-1])
import itertools
import sys
import math
import numpy as np
from collections import deque
from itertools import combinations
from functools import lru_cache
sys.setrecursionlimit(10**9)

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

    lcm = np.lcm.reduce(A)
    _, ans = divmod(sum(map(lambda a: lcm // a ,A)), (10**9+7))

    print(ans)

if __name__ == "__main__":
  main()


### FIXED CODE ###

import itertools
import sys
import math
import fractions
from collections import deque
from itertools import combinations
from functools import reduce
from functools import lru_cache
sys.setrecursionlimit(10**9)

def get_lcm(num):
    return reduce(lambda x,y:(x * y) // fractions.gcd(x, y), num, 1)

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

    lcm = get_lcm(A)
    sum = 0
    for a in A:
      sum += lcm // a
    _, ans = divmod(sum, (10**9+7))

    print(ans)

if __name__ == "__main__":
  main()
import sys
c={
    'S':[0]*13,
    'H':[0]*13,
    'C':[0]*13,
    'D':[0]*13
}
n=int(input())
for i in range(n):
    s,num=input().split()
    c[s][int(num)-1]=1
for i in['S','H','C','D']:
    for j in range(13):
        if c[i][j]==0:
            print(i,j+1)



### FIXED CODE ###

# -*- coding: utf-8 -*-
'import sys'
c={
    'S':[0]*13,
    'H':[0]*13,
    'C':[0]*13,
    'D':[0]*13
}
n=int(input())
for i in range(n):
    s,num=input().split()
    c[s][int(num)-1]=1
for i in["S","H","C","D"]:
    for j in range(13):
        if c[i][j]==0:
            print(i,j+1)
l,r = map(int,input().split())
ans=2019
for i in range(l,r+1):
    for j in range(i+1,r+1):
        ans=min((i*j)%2019,ans)
        
        
print(ans)

### FIXED CODE ###

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



print(min([b,n*a]))
x = int(input())
print(3.141592653589793 * x**2, 3.141592653589793 * 2* x)


### FIXED CODE ###

#x = [int(i) for i in input().split()]
x = float(input())
print(3.141592653589793 * x**2, 3.141592653589793 * 2* x)
import math

R = input()

print R * 2 *math.pi()

### FIXED CODE ###

import math

R = int(input())

print (float(R*2*math.pi))
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

s = input().strip()
t = input().strip()
ans = 0
for i in range(n):
    if s[i] != t[i]:
        ans += 1
print(ans)
    


### FIXED CODE ###

#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

s = input().strip()
t = input().strip()
n = len(s)
ans = 0
for i in range(n):
    if s[i] != t[i]:
        ans += 1
print(ans)
color = input()



if color >= 3200:
  print(str(color))
else:
  print('red')

### FIXED CODE ###

num = int(input())
color = input()
 
if num >= 3200:
  print(color)
else:
  print('red')
N = int(input())
vals = [int(v) for v in input().split()]

rslt = 1

for v in vals:
  rslt = rslt * v
  
  if rslt > 10 ** 18:
    rslt = '-1'

print(rslt)
    


### FIXED CODE ###

N = int(input())
vals = [int(v) for v in input().split()]

rslt = 1

if 0 in vals:
  rslt = 0

for v in vals:
  rslt = rslt * v
  
  if rslt > 10 ** 18:
    rslt = -1
    break

print(rslt)
NK = list(map(int, input().split())) 
A = list(map(int, input().split())) 

N = NK[0]
K = NK[1]

town = 0
for i in range(K-1):
  town = A[town]
  
print(str(town))

### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split())) 
b = 0
if k<=n:
  for i in range(k):
    b = a[b]-1
  print(b+1)
  exit(0)
c = [0]
for i in range(n):
  b = a[b]-1
  c.append(b)
d = c[:-1].index(c[-1])
c = c[d:-1]
k = k-d
print(c[k%len(c)]+1)
a = input()
if a < 1200:
  print("ABC")
else if a < 2800:
  print("ARC")
else:
  print("AGC")

### FIXED CODE ###

a = int(input())
if a < 1200:
 print("ABC")
elif a < 2800:
 print("ARC")
else:
 print("AGC")
s = input()[::-1]

counts = [0]*2019 # 剰余の余りの回数を保存
counts[0] = 1 # 0%2019を累積和として含めることを想定

num, d = 0,1　# numは余りの累積和、dはcharの桁数
'''
charに一桁ずつ取り出す。そのmod2019を考え、累積和をとる。
しかし、それぞれの数字には10の累乗がかかっているので、それについては別途dを用意してmod2019をとる
つまり、numは1桁目のmod2019、2桁目のmod2019に1桁目のmod2019を加える
'''
for char in s:
  num += int(char) * d
  num %= 2019
  d *= 10
  d %= 2019
  counts[num] += 1

ans = 0
for c in counts:
  ans += c*(c-1)//2
  
print(ans)

### FIXED CODE ###

import collections 
s = input()

n = len(s)
m = [0]
mod = 0
ten = 1
for i in s[::-1]:
  mod += (int(i)*ten)%2019
  mod %= 2019
  m.append(mod)
  ten *= 10
  ten %= 2019

count = collections.Counter(m)
print(sum([c*(c-1)//2 for c in count.values()]))
N, K = map(int, input().split())
L = list(map(int, input().split()))
dp = [-1 for k in range(K+1)]
dp[0] = 1
def fn(n):
	if dp[n] != -1:
		return dp[n]
	for i in L:
      if n >= i:
		if fn(n-i) == 1:
			dp[n] = 0
			return 0
	dp[n] = 1
	return 1
for l in range(1, 	K):
	fn(l)
if fn(K) == 0:
	print("First")
else:
	print("Second")

### FIXED CODE ###

N, K = map(int, input().split())
L = list(map(int, input().split()))
dp = [-1 for k in range(K+1)]
# dp[0] = 1
def fn(n):
	if dp[n] != -1:
		return dp[n]
	if n == 0:
		dp[n] = 0
		return dp[n]
	ans = 0
	for i in L:
		if n >= i:
			if fn(n-i) == 0:
				ans = 1
				break
	dp[n] = ans		
	return dp[n]
for l in range(K):
	fn(l)
if fn(K) == 1:
	print("First")
else:
	print("Second")
#from statistics import median
import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from fractions import gcd
#from itertools import combinations # (string,3) 3回
#from collections import deque
#from collections import deque,defaultdict
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
S = readInts()
i = 0
cnt = 0
while i < n:
    while i+1 < n:
        if S[i] == S[i+1]:
            i += 1
        else:
            break
    if i + 1 < n:
        if S[i] < S[i+1]:
            while i + 1 < n:
                if S[i] =< S[i+1]:
                    i += 1
                else:
                    break
        else:
            while i + 1 < n:
                if S[i] >= S[i+1]:
                    i += 1
                else:
                    break
    cnt += 1
    i += 1
print(cnt)


### FIXED CODE ###

from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n = int(input())
    A = readInts()
    res = 0
    # 同じおなじやつは同じ奴でずっと続く
    i = 0
    while i < n:
        # 同じもの
        while i+1 < n:
            if A[i] == A[i+1]:
                i += 1
            else:
                break
        # 無くなったら、
        # もし先に上のものを見つけたら、ずっと上を探索する
        if i+1 < n:
            if A[i] < A[i+1]:
                while i+1 < n:
                    if A[i] <= A[i+1]:
                        i+=1
                    else:
                        break
        # どちらかなので、elifで。
            elif i + 1 < n:
                if A[i] > A[i+1]:
                    while i + 1 < n:
                        if A[i] >= A[i+1]:
                            i += 1
                        else:
                            break
        # ここで1ループは終わりなので、カウントに+1する
        #print(i)
        res += 1
        i += 1
    print(res)
if __name__ == '__main__':
  main()
s = int(input())
n = "1"
string_list = [input() for i in range(n)]
int_list = (int(s) for s in string_list)
m = max(int_list)
if sum(int_list) - int(m) > int(m):
    print("Yes")
else:
    print("NO")

### FIXED CODE ###

s = input().split()
print(int(s[0])/int(s[1]))
N,M=map(int,input().split(" "))

listing=[]
for i in range(M):
    a=list(map(int,input().split(" ")))
    listing.append(a)


aa=list(map(list, set(map(tuple, listing))))


if(N==1 and aa[0][0]==1):
    print(aa[0][1])
    exit()

a1=[]
a2=[]
for i in aa:
    a1.append(i[0])
    a2.append(i[0])
if(len(a1)!=len(set(a2))):
    print(-1)
    exit()

num=""
#print(aa)
digit=1
digit1=1
for i in range(N):
    digit1=digit
    for j in aa:
        if(j[0]==1 and j[1]==0):
            print(-1)
            exit()
        if(j[0]==digit):
            num+=str(j[1])
            digit1=digit+1
            break
    if(digit1==digit):
        if(digit==1):
            num+="1"
        else:
            num+="0"
    digit+=1
print(num)
            


### FIXED CODE ###

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

if(M==0):
    if(N==1):
        print(0)
    elif(N==2):
        print(10)
    elif(N==3):
        print(100)
    exit()



listing=[]

for i in range(M):
    a=list(map(int,input().split(" ")))
    listing.append(a)


aa=list(map(list, set(map(tuple, listing))))




a1=[]
a2=[]
for i in aa:
    a1.append(i[0])
    a2.append(i[0])
if(len(a1)!=len(set(a2))):
    print(-1)
    exit()

if(N==1 and aa[0][0]==1):
    print(aa[0][1])
    exit()
num=""
#print(aa)
digit=1
digit1=1
for i in range(N):
    digit1=digit
    for j in aa:
        if(j[0]==1 and j[1]==0):
            print(-1)
            exit()
        if(j[0]==digit):
            num+=str(j[1])
            digit1=digit+1
            break
    if(digit1==digit):
        if(digit==1):
            num+="1"
        else:
            num+="0"
    digit+=1
print(num)
from typing import List
import sys

n = int(input())
h_list: List[int] = [int(x) for x in input().split(" ")]

dp: List[int] = [sys.maxsize] * len(h_list)
dp[0] = 0
dp[1] = abs(h_list[1] - h_list[0])
for i in range(2, len(dp)):
  dp[i] = min(dp[i - 1] + abs(h_list[i] - h_list[i-1]), dp[i - 2] + abs(h_list[i] - h_list[i - 2]))

print(dp[-1])

### FIXED CODE ###

import sys

n = int(input())
h_list = [int(x) for x in input().split(" ")]

dp = [sys.maxsize] * len(h_list)
dp[0] = 0
dp[1] = abs(h_list[1] - h_list[0])
for i in range(2, len(dp)):
  dp[i] = min(dp[i - 1] + abs(h_list[i] - h_list[i-1]), dp[i - 2] + abs(h_list[i] - h_list[i - 2]))

print(dp[-1])
N=int(input())
S=[]
for i in range(N):
    a = int(input())
    if not a in S:
        S.append(a)
print(len(S))

### FIXED CODE ###

N=int(input())
S=[]
for i in range(N):
    S.append(input())
print(len(set(S)))
#b
n=int(input())
xl=[]
for i in range(n):
    xl.append( list( map(int,input().split()) ) )

xl.sort(key=lambda x:x[0])


x = [xl[i][0] for i in range(n)]
l = [xl[i][1] for i in range(n)]
left = [x[i]-l[i] for i in range(n)]
right= [x[i]+l[i] for i in range(n)]

import bisect
rinsetu=[]
for i in range(n):
    migite   = bisect.bisect_left(left, right[i])
    hidarite = bisect.bisect_right(right, left[i]) 
#    print(migite,hidarite)
    migite_catch   = list(range(i+1,migite) )
    hidarite_catch = list(range(hidarite,i) )
    rinsetu.append( hidarite_catch + migite_catch )
#    rinsetu.append( migite_catch )

# n=6
# rinsetu=[[1,2],[0,2,3],[0,1,3,4],[1,2],[2,5],[4]]
def remove_oya1(lis,c):
    neighbor = lis[:]
    i0=c
    for i in range(n):
        if len(neighbor[i]) == 1:
            oya=neighbor[i][0]
            for r in neighbor[oya]:
                neighbor[r].remove(oya)
            neighbor[oya]=[]
            i0+=1
    return neighbor, i0

def remove_biggest(lis,c):
    neighbor = lis[:]
    i0=c
    to_delete=0
    max_len=0
    for i in range(n):
        if len(neighbor[i]) > max_len:
            max_len=len(neighbor[i]) 
            to_delete=i
    
    oya=neighbor[to_delete]
    for r in oya:
        neighbor[r].remove(to_delete)
    neighbor[to_delete]=[]
    i0+=1
    return neighbor,i0

ans = 0
if sum(len(r) for r in rinsetu)==0:
    print(n)
else:
    rinsetu,ans = remove_oya1(rinsetu,ans)
while True:
    if sum(len(r) for r in rinsetu) > 0:
        rinsetu,ans = remove_biggest(rinsetu,ans)
    else:
        print(n-ans)
        break
    
    if sum(len(r) for r in rinsetu) > 0:
        rinsetu,ans = remove_oya1(rinsetu,ans)
    else:
        print(n-ans)
        break


    


### FIXED CODE ###

n=int(input())
xlr=[[] for _ in range(n)]

for i in range(n):
    xx,ll = map(int,input().split())
    xlr[i] = [xx,ll,xx-ll,xx+ll]
    
xlr.sort(key = lambda x:x[3])

ans=1
right=xlr[0][-1]
for i in range(1,n):
    if right <= xlr[i][2]:
        ans+=1
        right=xlr[i][-1]

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

if (a+b+c) % 3 == 0:P
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b,c = map(int, input().split())

s = sum([a,b,c])
m = max(a,b,c)

if m == (s - m):
  print("Yes")
else:
  print("No")
a, b = map(int, input().split())
A = 'ABCDEFGHIJKLMN'
ans = ""
for i in range(a):
  t = list(input().split())
  if 'snuke' in t:
    ans += A[t.index("snuke")]
    ans += str(i + 1)
print(ans)


### FIXED CODE ###

a, b = map(int, input().split())
A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ""
for i in range(a):
  t = list(input().split())
  if 'snuke' in t:
    ans += A[t.index("snuke")]
    ans += str(i + 1)
print(ans)
import collections
import numpy

def main():
    max_n = 10**18
    n = int(input())
    a = input_list()
    if 0 in a:
        print(0)
        exit()

    ans = numpy.prod(a)
    if ans > max_n:
        print(-1)
    else:
        print(int(ans))

def input_list():
    return list(map(int, input().split()))


if __name__ == '__main__':
    main()


### FIXED CODE ###

#import numpy
import math
import sys

def main():
    n = int(input())
    a = sorted(input_list())
    max_n = 10 ** 18
    ans = 1
    for v in a:
        ans *= v
        if ans > max_n:
            ans = -1
            break
        if ans == 0:
            break
    print(ans)


def yogen(a, b, angle):
    coss = math.cos((angle/180)*math.pi)
    return math.sqrt(a**2 + b**2 - 2*a*b*coss)


def get_angle(hour, minute):
    h = (hour * 360) / 12 + (minute * 360) / (12 * 60)
    m = (minute * 360) / 60
    angle = abs(h-m)
    return min(angle, 360-angle)

def has(v, l):
    for vl in l:
        if v == vl:
            return True
    return False

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


if __name__ == '__main__':
    main()
import math

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

gcd_l = [0]
gcd_r = [0]

for i in range(N):
    gcd_l.append(math.gcd(gcd_l[i], A[i]))
    gcd_r.append(math.gcd(gcd_r[i], A[-(i+1)]))
gcd_r = gcd_r[::-1]

ans = []
for i in range(N):
    ans.append(math.gcd(gcd_l[i], gcd_r[i+1]))
print(max(ans))

### FIXED CODE ###

import fractions


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

gcd_l = [0]
gcd_r = [0]
for i in range(N):
    gcd_l.append(fractions.gcd(gcd_l[i], A[i]))
    gcd_r.append(fractions.gcd(gcd_r[i], A[-(i+1)]))
gcd_r = gcd_r[::-1]

ans = []
for i in range(N):
    ans.append(fractions.gcd(gcd_l[i], gcd_r[i+1]))

print(max(ans))