Harryxun/stf_run huggingface dataset:
import numpy as np

N, X = map(int, input().split())
city = [X] + list(map(int, input().split()))
city_diff = np.array([abs(city[i + 1] - city[i]) for i in range(N)])
ans = np.gcd.reduce(city_diff)
print(ans)

### FIXED CODE ###

def gcd(x, y):
    if y > x:
        return gcd(y, x)
    elif x == 0:
        return 0
    else:
        z = x % y
        if z == 0:
            return y
        else:
            return gcd(y, z)

N, X = map(int, input().split())
city = [X] + list(map(int, input().split()))
city_diff = [abs(city[i + 1] - city[i]) for i in range(N)]
ans = city_diff[0]
for i in range(1, N, 1):
    ans = gcd(ans, city_diff[i])
print(ans)
a=input()
if len(a)%2==0:
    for i in range(len(a)-3):
        b="{}".format(a[i]+a[i+1]+a[i+2]+a[i+3])
        c=list(set(a[i:i+4]))
        if (len(c)==2)&(b!="{}".format(c[0]+c[0]+c[1]+c[1]))&(b!="{}".format(c[1]+c[1]+c[0]+c[0])):
            print("{}".format(i+1)+" "+"{}".format(i+4))
            break
    else:
        print("-1 -1")
else:
    for j in range(len(a)-2):
        d="{}".format(a[j]+a[j+1]+a[j+2])
        e=list(set(a[i:i+3]))
        if len(e)==2 or len(e)==1:
            print("{}".format(i+1)+" "+"{}".format(i+3))
    else:
        print("-1 -1")

### FIXED CODE ###

a=input()
if len(a)==1:
    print("-1 -1")
elif (len(a)==2)&(len(list(set(a)))==1):
    print("1 2")
else:
    for i in range(len(a)-2):
        e=list(set(a[i:i+3]))
        if (len(e)==2) or (len(e)==1):
            print("{}".format(i+1)+" "+"{}".format(i+3))
            break
    else:
        print("-1 -1")
a,b=map(nt,input().split())
print("Even" if (a*b)%==0 else "Odd")

### FIXED CODE ###

a,b=map(int,input().split())
print("Even" if (a*b)%2==0 else "Odd")
# 新ステージでは、一度全部どんぐりに直してから換金を始めるとしてよい

def F(N, A, B):
  # N個のどんぐりを、Aで換金してからBに持っていく
  # Bでどんぐりに直す
  A,B = zip(*(x,y for x,y in zip(A,B) if x < y))
  dp = [0] * (N+1)
  for n in range(N+1):
    x = n
    for j in range(3):
      if n >= A[j]:
        y = dp[n-A[j]] + B[j]
        if x < y:
          x = y
    dp[n] = x
  return dp[N]

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

answer = F(F(N,A,B),B,A)
print(answer)


### FIXED CODE ###

# 新ステージでは、一度全部どんぐりに直してから換金を始めるとしてよい

def F(N, A, B):
  # N個のどんぐりを、Aで換金してからBに持っていく
  # Bでどんぐりに直す
  dp = [0] * (N+1)
  for n in range(N+1):
    x = n
    for j in range(3):
      if n >= A[j]:
        y = dp[n-A[j]] + B[j]
        if x < y:
          x = y
    dp[n] = x
  return dp[N]

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

answer = F(F(N,A,B),B,A)
print(answer)
s = input()
s.sort()
print('Yes' if ''.join(s) == 'abc' else 'No')

### FIXED CODE ###

s = list(input())
s.sort()
print('Yes' if ''.join(s) == 'abc' else 'No')
S=input()
K=int(input())

ans = '1'
pos = 0

while(ans=='1' and pos<=K):
  if S[pos] != '1':
    ans = S[pos]
  pos+=1
  
print(ans)

### FIXED CODE ###

S=input()
K=int(input())

ans = '1'
pos = 0

while(ans=='1' and pos<K):
  if S[pos] != '1':
    ans = S[pos]
  pos+=1
  
print(ans)
s=int(input())
ans=1
for i in range(1,s+1)
    ans*=i

print(ans)

### FIXED CODE ###

s=int(input())
ans=1
for i in range(1,s+1):
    ans *= i

print(ans)
import math
n = int(input())
la = [int(i) for i in input().split()]
la.sort(reverse=True)
ans = 1

if la[-1] == 0:
    print(0)
    exit()

for a in la:
    if math.log10(a) > 18:
        print(-1)
        exit()
    ans *= a
    elif ans % 10 == 0 and math.log10(ans) == 18:
        print(ans)
    elif math.log10(ans) > 18:
        print(-1)
        exit()
print(ans)

### FIXED CODE ###

import math
n = int(input())
la = [int(i) for i in input().split()]
la.sort(reverse=True)
ans = 1

if la[-1] == 0:
    print(0)
    exit()

for a in la:
    if a > 1000000000000000000:
        print(-1)
        exit()
    ans *= a
    if ans > 1000000000000000000:
        print(-1)
        exit()
print(ans)
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

idx = {chr(i): [] for i in range(65, 92)}

n,q = li()
s = ns()


from_left = [(si, 'L') for si in s]
from_right = [(si, 'R') for si in s[::-1]]

query = [tuple(ls()) for _ in range(q)]

left_cur = 0
right_cur = 0

for qi in query[::-1]:
    if qi == from_left[left_cur]:
        left_cur += 1
        
    if qi == from_right[right_cur]:
        right_cur += 1
        
print(max(n - (left_cur + right_cur), 0))

### FIXED CODE ###

import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

# シミュレーション関数
def to_end(num, board, query, goal):
    for (qs, qd) in query:
        if qs == board[num]:
            if qd == 'L':
                num -= 1
            elif qd == 'R':
                num += 1
                
            if num == goal:
                return True
            
    return False


# 左へ二分探索
def find_rightest_left(board, query):
    left = 0
    right = len(board)-1
    
    while right-left > 1:
        mid = (left+right) // 2
        if to_end(mid, board, query, 0):
            left = mid
        else:
            right = mid
            
    return left
            
# 右へ二分探索
def find_leftest_right(board, query):
    R = len(board)-1
    left = 0
    right = R
    
    while right-left > 1:
        mid = (left+right) // 2
        if to_end(mid, board, query, R):
            right = mid
        else:
            left = mid
            
    return R - right
    
n,q = li()
board = "0" + ns() + "0"
query = [tuple(ls()) for _ in range(q)]

rightest_left = find_rightest_left(board, query)
leftest_right = find_leftest_right(board, query)

print(max(n - rightest_left - leftest_right, 0))
N = int(input())
data = list(map(int,input().split()))

Alice = []
Bob = []

while N != 0:
        Alice.append(max(data))
        data.remove(max(data))
        if len(data) == 0:
                break
        else:
                Bob.append(max(data))
                data.remove(max(data))
        N -= 1

print(sum(Alice)-sum(Bob))

### FIXED CODE ###

n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
print(sum(a[::2]) - sum(a[1::2]))
s = input()[::-1]
size = len(s)
s += "9"

ans = 0
bef = 0

for i in range(size):
    v1 = int(s[i])
    v2 = int(s[i+1])
    if v1+bef>=6 or (v1+bef>=5 and v2>=5):
        ans += 10-(v1+bef)
        bef = 1
    else:
        ans += (v1+bef)
        bef = 0

ans += (v+bef)//10
print(ans)

### FIXED CODE ###

s = input()[::-1]
size = len(s)
s += "4"

ans = 0
bef = 0

for i in range(size):
    v1 = int(s[i])
    v2 = int(s[i+1])
    if v1+bef>=6 or (v1+bef>=5 and v2>=5):
        ans += 10-(v1+bef)
        bef = 1
    else:
        ans += (v1+bef)
        bef = 0

ans += bef
print(ans)
import numpy as np
N, M = map(int, input().split())

key = np.zeros(N)
for i in range(0, M):
    L, R = map(int, input().split())
    for j in range(L, R+1):
        key[j-1]+=1

print(np.sum(key==M))

### FIXED CODE ###

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

if(A>=13):
    print(B)
elif(A>=6):
    print(B//2)
else:
    print("0")
count = 0
total = 0
for i in sorted(a_i):
    total = total + i
    count = count + 1
    if count == 2:
        break
print(total)

### FIXED CODE ###

a_i = list(map(int, input().split()))
count = 0
total = 0
for i in sorted(a_i):
    total = total + i
    count = count + 1
    if count == 2:
        break
print(total)
n = int(input())
for s in range(1,10) :
    if n <= s*1000 :
        x = s*1000 - n 
        break
print(x)

### FIXED CODE ###

n = int(input())
 
if n % 1000 == 0 :
    a = n / 1000
else :
    a = int(n / 1000 + 1)
 
b = a * 1000
answer = int(b - n)
 
print(answer)
l = len(n)
count = 0
for i in range(l-3):
  x = 0
  for j in range(i+3, l):
    if j == i+3:
      x = int(n[i]) + int(n[i+1]) + int(n[i+2]) + int(n[i+3])
    else:
      x += int(n[j])
    
    if x % 3 != 0:
      continue
    else:
      integer = int(n[i:j+1])
      if integer % 2019 == 0:
        count += 1
print(count)


### FIXED CODE ###

n = input()
mod = [0]*2019
mod[0] += 1
T = 0
d = 1 # 桁数
for i, s in enumerate(n[::-1]):
  T += int(s) * d
  T %= 2019
  d = (d * 10) % 2019
  mod[T] += 1
  
res = 0  
for m in mod:
  res += m*(m-1)/2
print(int(res))
A, B, C, D = map(int, input().split())

if A <= C:
    print(max(min(B, D) - C), 0)
else:
    print(max(min(B, D) - A), 0)


### FIXED CODE ###

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

if A <= C:
    print(max(min(B, D) - C, 0))
else:
    print(max(min(B, D) - A, 0))
N = int(input())
W = []
G = [[] for i in range(N+1)]
for i in range(N-1):
    a,b = map(int,input().split())
    W.append((a,b))
    G[a].append(b)
    G[b].append(a)
K = 0
for i in range(1,N+1):
    n = len(G[i])
    K = max(K,n)
print(K)
C = [[i for i in range(1,K+1)] for j in range(N+1)]
import copy 
w = copy.deepcopy(W)
d = [[0 for i in range(N+1)] for j in range(N+1)]
w.sort()
for i in range(N-1):
    a,b = W[i]
    print(d[a][b])


### FIXED CODE ###

S = input()
if S == 'SUN':
    print(7)
elif S == 'MON':
    print(6)
elif S == 'TUE':
    print(5)
elif S == 'WED':
    print(4)
elif S == 'THU':
    print(3)
elif S == 'FRI':
    print(2)
else:
    print(1)
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
s = 0
for i in range(n):
    s += max(0,v[i]-c[i])
print(s)

### FIXED CODE ###

a,b,t=map(int,input().split())
print((t//a)*b)
# -*- coding: utf-8 -*-
import numpy as np
iNum, iK = map(int, input().split())
iK -= 1
naA = np.array(list(map(int, input().split())), dtype = "int64")
naA = np.sort(naA)
naA = list(naA)
#print(naA)
iMod = 1000000007
iRet*=0
iNmrt = 1
iDnmt = 1
for iK0 in range(iK):
  iNmrt *= iNum - iK0
  iDnmt *= iK0 + 1
iU0= iNmrt // iDnmt
#print(iNum, iK, iU0)
iL0=0
iU = iNum
for iL, iA in enumerate(naA):
  iU -= 1
  if iL > iK:
    iL0 *= iL
    iL0//= iL - iK
  elif iL == iK:
    iL0 = 1
  else:
    iL0 = 0
  if iU >= iK:
    iU0 *=  iU+1-iK
    iU0 //= iU+1
  else:
    iU0 = 0
  #print("iU, iK, iU0, iA :",iU,iK,iU0, iA)
  #print("iL, iK, iL0, iA :",iL,iK,iL0, iA)
  iL0mU0=  iL0 - iU0
  iRet0 = (iL0mU0 * iA) % iMod
  iRet += iRet0
  #print(iRet0)
  iAp = iA
print(iRet%iMod)


### FIXED CODE ###

# -*- coding: utf-8 -*-
import numpy as np

iMod = 1000000007
lModPow = [iP for iP, s in enumerate(bin(iMod-2)[:1:-1]) if s == "1"]

def fnModInv(iDivN):
  lNp  = [iDivN % iMod]
  for _ in range(max(lModPow)):
    lNp.append(lNp[-1]**2 % iMod)
  iRet = 1
  for iP in lModPow:
    iRet *= lNp[iP]
    iRet %= iMod
  return iRet

def fnSolv():
  iNum, iK = map(int, input().split())
  naU = [0]*iNum
  naA = np.array(list(map(int, input().split())), dtype = np.int64)
  naA = np.sort(naA)
  iRet =0
  if iK >= 2:
    naU[-iK] = 1
    for iK0 in range(iNum - iK):
      naU[-iK -iK0 - 1]= ( (naU[- iK - iK0] * (iK + iK0))%iMod * fnModInv(iK0 + 1) )%iMod
  for iL, iA in enumerate(naA):
    iRet += ((naU[-iL-1] - naU[iL])%iMod * iA)%iMod
    iRet %=iMod
  print(iRet)

if __name__ == '__main__':
  fnSolv()
import sys
sys.recursionlimit(100000)
n,q=map(int,input().split())
G=[[]*n for i in range(n)]
P=[0]*n
V=[0]*n
R=[0]*n
for i in range(n-1):
	a,b=map(int,input().split())
	G[a-1].append(b-1)
	G[b-1].append(a-1)
for i in range(q):
	c,d=map(int,input().split())
	P[c-1]+=d

print(G)
def dsf(i,p):
    V[i]=1
    R[i]+=p+P[i]
    p=0
    if G[i]!=[]:
        for j in G[i]:
            if V[j]!=1:
                dsf(j,R[i])
dsf(0,0)
print(' '.join(map(str,R)))

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)
s=sys.stdin.readlines()
n,q=map(int,s[0].split())
G=[[]*n for i in range(n)]
P=[0]*n
V=[0]*n
R=[0]*n
for e in s[1:n]:
    a,b=map(int,e.split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)
for e in s[n:]:
    c,d=map(int,e.split())
    P[c-1]+=d

def dsf(i,p):
    V[i]=1
    R[i]+=p+P[i]
    p=0
    for j in G[i]:
        if V[j]!=1:
            dsf(j,R[i])
dsf(0,0)
print(' '.join(map(str,R)))
import sys
n, m = map(int, input().split())
S = [0] * m
C = [0] * m
tmp = [0] * n

for i in range(m):
    S[i], C[i] = map(int, input().split())

for s, c in zip(S, C):
    if tmp[s-1] == 0:
        tmp[s-1] = c
    elif tmp[s-1] == c:
        pass
    else:
        print(-1)
        sys.exit()

ans = 0
for i, a in enumerate(tmp[::-1]):
    ans += a*10**(i)

print(ans)

### FIXED CODE ###

import math
print(math.ceil(int(input())/2))
N = int(input().strip())
A = [int(v) for v in input().strip().split()]
C = {}
S = {}

for a in A:
    C.setdefault(a, 0)
    C[a] += 1

for c in C.values():
    if c < 1:
        continue
    C.setdefault(c, c * (c - 1) // 2)
    if c < 2:
        continue
    C.setdefault(c - 1, c * (c - 1) // 2)

for i, a in enumerate(A):
    C[a] -= 1
    sum_ = sum([S[n] for n in C.values() if n > 1])
    C[a] += 1
    print(sum_)

### FIXED CODE ###

from functools import lru_cache

N = int(input().strip())
A = [int(v) for v in input().strip().split()]
C = {}


@lru_cache(maxsize=None)
def pair(k):
    return k * (k - 1) // 2

@lru_cache(maxsize=None)
def calc(s, a):
    return s - pair(C[a]) + pair(C[a] - 1)

for a in A:
    C.setdefault(a, 0)
    C[a] += 1

S = sum([pair(v) for v in C.values()])

for a in A:
    print(calc(S, a))
from numba import njit

@njit('(i4,i4,i4[::-1],i4[::-1],i4[::-1])', cache=True)
def calc(N, M, A, X, Y):
    ans = 0
    for a in A:
        aa = (a // N + 1) * M + a % N + 1
        ans += X[aa]
        h = X[aa]
        if h < 0: continue
        Q = [(aa, h)]
        q = 0
        X[aa] -= 1
        Y[aa] = 0
        dd = (-1, 1, M, -M)
        while q < len(Q):
            i, h = Q[q]
            q += 1
            for d in dd:
                j = i + d
                y = Y[j]
                if X[j] >= h + y:
                    X[j] -= 1
                    Q.append((j, h + y))
    return ans

N = int(input())
A = [int(a)-1 for a in input().split()]
M = N + 2
X = [max(min(i-1, j-1, M-2-i, M-2-j), -1) for j in range(M) for i in range(M)]
Y = [min(x, 0) + 1 for x in X]
print(calc(N, M, A, X, Y))

### FIXED CODE ###

from collections import deque
N = int(input())
A = [int(a)-1 for a in input().split()]
M = N + 2
X = [max(min(i-1, j-1, M-2-i, M-2-j), -1) for j in range(M) for i in range(M)]
Y = [min(x, 0) + 1 for x in X]

def calc(i0):
    h = X[i0]
    if h < 0: return
    Q = deque([(i0, h)])
    X[i0] -= 1
    Y[i0] = 0
    dd = (-1, 1, M, -M)
    while Q:
        i, h = deque.popleft(Q)
        for d in dd:
            j = i + d
            y = Y[j]
            if X[j] >= h + y:
                X[j] -= 1
                deque.append(Q, (j, h + y))
ans = 0
for a in A:
    aa = (a // N + 1) * M + a % N + 1
    ans += X[aa]
    calc(aa)
print(ans)
n, k, q= map(int, input().split())
a = [int(input()) for i in range(q)]

b = [k - q] * n

for i in range(q):
    b[a[i - 1]] += 1

for i in range(n):
    if b[i] > 0:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

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

b = [k - q] * n

for i in range(q):
    b[a[i] - 1] += 1

for j in range(n):
    if b[j] > 0:
        print('Yes')
    else:
        print('No')
N=int(input())
h_list=[int(x) for x in input().split()]

flag=True

for j in range(1,len(tmp)):
    for i in range(len(h_list)-j):  
        if h_list[i]-h_list[i+j]>=2:
            flag=False
            break
    
if flag:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

flag=True

m=h_list[0]
for j in range(len(h_list)-1):
    if m<h_list[j]:
        m=h_list[j]
    if m-h_list[j+1]>=2:
        flag=False
        break        
    
if flag:
    print("Yes")
else:
    print("No")
q=int(input())
for i in range(q):
    a,b=map(int,input().split())
    left=0
    right=a*b
    for i in range(100):
        mid=(left+right)//2
        if mid*mid<a*b:
            left=mid
        else:
            right=mid
    ret=left*2
    if (a*b-1)//left==left:
        ret-=1
    if min(a,b)<=left:
        ret-=1
    print(ret)


### FIXED CODE ###

q=int(input())
for i in range(q):
    a,b=map(int,input().split())
    left=0
    right=a*b
    for i in range(100):
        mid=(left+right)//2
        if mid*mid<a*b:
            left=mid
        else:
            right=mid
    ret=left*2
    if ret==0:
        print(ret)
        continue
    if (a*b-1)//left==left:
        ret-=1
    if min(a,b)<=left:
        ret-=1
    print(ret)
while True:
    n = input()
    if n == 0:
        break

    rs = {}
    for i in range(n):
        arr = input().split(' ')
        s = arr[0] * arr[1]
        rs[arr[0]] = (rs[arr[0]] or 0) + s

    top = [k for k, v in rs.items if v > 1000000]
    if len(top) == 0:
        print('NA')
    else:
        for i in top:
            print(i)

### FIXED CODE ###

while True:
  n = int(input())
  if n == 0:
    break
  c = 0
  l = []
  d = {}
  for i in range(n):
    num,x,y = map(int,input().split())
    if num in d:
      d[num] = d[num] + x*y
    else:
      d[num] = x*y
      l.append(num)
  for i in l:
    if d[i] >= 1000000:
      print(i)
      c += 1
  if c == 0:
    print('NA')
H, N = map(int, input().split())
A= [0] * N
for i in range(N):
    A[i]= map(int, input().split())
if sum(A)>=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")
s = input()
s2 = s.replace('x', '')
if s2 != s2[::-1]:
    print(-1)
else:
    center = s2[len(s2)//2]
    cnt = s.count(center)//2 + 1
    for i, c in enumerate(s):
        if c == center:
            cnt -= 1
        if cnt == 0:
            center_idx = i
            break

    front = list(s)[:center_idx]
    rear = list(s)[center_idx+1:][::-1]
    if len(front) == 0 or len(rear) == 0:
        print(max(len(front), len(rear)))
    else:
        a, b = front.pop(), rear.pop()
        cnt = 0
        while True:
            if a == b:
                if 0 < len(front):
                    a = front.pop()
                if 0 < len(rear):
                    b = rear.pop()
                continue
            if a == 'x' and b != 'x':
                cnt += 1
                if 0 < len(front):
                    a = front.pop()
            if a != 'x' and b == 'x':
                cnt += 1
                if 0 < len(rear):
                    b = rear.pop()
            if len(front) == 0 and len(rear) == 0:
                break
        print(cnt)


### FIXED CODE ###

from collections import deque

s = input()
s2 = s.replace('x', '')
if s2 != s2[::-1]:
    print(-1)
else:
    d = deque(s)
    a, b = [], []
    cnt = 0
    x = y = ''
    x_skip = y_skip = 0
    while d:
        if not x_skip:
            x = d.popleft()
        if 0 < len(d)and not y_skip:
            y = d.pop()

        if y == '':
            break

        if x == y != 'x':
            cnt += abs(len(a)-len(b))
            x = y = ''
            a, b = [], []
            x_skip = y_skip = 0
            continue

        if x == 'x':
            a.append(x)
        else:
            x_skip = 1

        if y == 'x':
            b.append('x')
        else:
            y_skip = 1
    else:
        cnt += abs(len(a)-len(b))

    print(cnt)
print(int(input())//3**3)

### FIXED CODE ###

from scipy.misc import comb

a,b = map(int,input().split()) #a even b odd
x = 0

x = comb(a, 2, exact=True) + comb(b, 2, exact=True)
    

print(x)
n=int(input())
a=list(map(int,input().split()))
import math
gcd=a[0]
l=[]
r=[]
for i in range(n):
	gcd=math.gcd(gcd,a[i])
	l.append(gcd)
gcd=a[-1]
for i in range(n):
	gcd=math.gcd(gcd,a[-i-1])
	r.append(gcd)
x=list()
x.append((r[n-2]))
for i in range(n-2):
	x.append(math.gcd(l[i],r[n-i-3]))
x.append((l[n-2]))
print(max(x))


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
import fractions
gcd=a[0]
l=[]
r=[]
for i in range(n):
	gcd=fractions.gcd(gcd,a[i])
	l.append(gcd)
gcd=a[-1]
for i in range(n):
	gcd=fractions.gcd(gcd,a[-i-1])
	r.append(gcd)
x=list()
x.append((r[n-2]))
for i in range(n-2):
	x.append(fractions.gcd(l[i],r[n-i-3]))
x.append((l[n-2]))
print(max(x))
n = int(input())
steps = list(map(int,input().split()))
dp = []

def frog(list,n,max):
    global dp
    if n == 0:
        dp.append(0)
        frog(list,1,max)
    else:
        temp1 = abs(list[n] - list[n-1]) + dp[n-1]

        if n == 1:
            dp.append(temp1)
            if n != max - 1:
                frog(list,2,max)
        else:
            temp2 = abs(list[n] - list[n-2]) + dp[n-2]
            if temp1 >= temp2:
                dp.append(temp2)
            else:
                dp.append(temp1)
            if n != max - 1:
                frog(list,n+1,max)

frog(steps,0,n)
print(dp[n-1])


### FIXED CODE ###

n = int(input())
steps = list(map(int,input().split()))
dp = []

def frog(list,n,max):
    global dp
    if n == 0:
        dp.append(0)
    else:
        temp1 = abs(list[n] - list[n-1]) + dp[n-1]

        if n == 1:
            dp.append(temp1)
        else:
            temp2 = abs(list[n] - list[n-2]) + dp[n-2]
            if temp1 >= temp2:
                dp.append(temp2)
            else:
                dp.append(temp1)
for i in range(n):
    frog(steps,i,n)
print(dp[n-1])
N = list(input())

N.reverse()

ans = 0
flag = False

for i,s in enumerate(N):
    n = int(s)
    
    if flag:
        n += 1
    
    if n<5:
        ans += n
        flag = False
    elif n>5:
        ans += 10-n
        flag = True
    else:
        if int(N[i+1])<5:
            ans += n
            flag = False
        else:
            ans += 10-n
            flag = True

if flag:
    ans += 1
    
print(ans)
        
        
    
    

### FIXED CODE ###


N = list(input())

N.reverse()

ans = 0
flag = False
L = len(N)
for i,s in enumerate(N):
    n = int(s)
    
    if flag:
        n += 1
    
    if n<5:
        ans += n
        flag = False
    elif n>5:
        ans += 10-n
        flag = True
    else:
        if i==L-1:
            ans += n
            flag = False
            break
            
        if int(N[i+1])<5:
            ans += n
            flag = False
        else:
            ans += 10-n
            flag = True

if flag:
    ans += 1
    
print(ans)
a,b = map(int, input().split())

if (a*b=1) or (a*b=3):
  print("Yes")
else:
  print("No")
  

### FIXED CODE ###

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

if (a*b)%2 == 1:
  print("Yes")
else:
  print("No")
# -*- coding: utf-8 -*-
a = int(input())
b = list(int(input().split()))
count = list()
for i in range(a):
  count[i] = 0
  while b[i] % 2 == 0:
    b[i] = b[i] / 2
    count[i] += 1
print(min(count))

### FIXED CODE ###

# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))
count = []
for i in range(n):
    count.append(0)
    while a[i] % 2 == 0:
        a[i] = a[i] / 2
        count[i] += 1
print(min(count))
n, k = input().split()
n = int(n)
k = int(k)
listnum = []
newlist = []
sumnum = 0
for a in range(n):
    listnum.append(int(input())
newlist = sorted(listnum)
for b in range(k):
    sumnum = sumnum + list[0]
print(sumnum)

### FIXED CODE ###

n, k = input().split()
n = int(n)
k = int(k)
listnum = input().split()
newlist = []
sumnum = 0

listnum = [int(n) for n in listnum]
newlist = sorted(listnum)
for b in range(k):
    sumnum = sumnum + newlist[b]
print(sumnum)
dict = {'A':10,'B':11,'C':12,'D':13,'E':14,'F':15}
X, Y = map(int(input().split(' ')))
if dict[X] < dict[Y]:
  print('<')
elif dict[X] == dict[Y]:
  print('=')
else:
  print('>')

### FIXED CODE ###

dict = {'A':10,'B':11,'C':12,'D':13,'E':14,'F':15}
X, Y = map(str,input().split(' '))
if dict[X] < dict[Y]:
  print('<')
elif dict[X] == dict[Y]:
  print('=')
else:
  print('>')