Harryxun/stf_run huggingface dataset:
from math import sqrt, log, pow
num = [i**5 for i in range(-1, 150)]
c = 0
def solve(X):
    try:
        for i in range(len(num)):
            a = num[i]
            for j in range(i+1):
                if a - num[j] == X:
                    x, y = i-1, j-1
                    # print(i-1, j-1)
                    assert x**5-y**5 == X
                    return x, y
    except IndexError:
        print(0)
print(*solve(int(input())))


### FIXED CODE ###

num = [i**5 for i in range(-121, 121)]
X = int(input())
for i in range(len(num)):
    a = num[i]
    for j in range(i+1):
        if a - num[j] == X:
            print(i-121, j-121)
            exit()
import math

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

if X<A:
	print(0)
else:
	print(10)

### FIXED CODE ###

S=input()

tmp=""
for i in range(len(S)):
	if tmp==S[i]:
		print("Bad")
		break
	else:
		tmp=S[i]
	if i==len(S)-1:
		print("Good")
tmp=input().split()
a=int(tmp[0])
b=int(tmp[1])
c=int(tmp[2])
d=int(tmp[3])
Flag=False
ta=b-a
tb=c-b
tc=c-a
if ta<0:
    ta=ta*(-1)
if tb<0:
    tb=tb*(-1)
if tc<0:
.    tc=tc*(-1)
if tc<=d:
    Flag=True
if ta<=d and tb<=d:
    Flag=True
if Flag:
    print('Yes')
else:
    print('NO')


### FIXED CODE ###

import sys
tmp=input().split()
a=int(tmp[0])
b=int(tmp[1])
c=int(tmp[2])
d=int(tmp[3])
da=a-b
db=b-c
dc=c-a
if a-b<0:
    da=b-a
if b-c<0:
    db=c-b
if c-a<0:
    dc=a-c
if dc<=d or da<=d and db<=d:
    print('Yes')
    sys.exit()
print('No')
A, B, C=map(int,input().split(' '))
if(A<C ans C<B):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

A, B, C=map(int,input().split(' '))
if((A-C)*(B-C)<0):
  print('Yes')
else:
  print('No')
k, n = [int(i) for i in input().strip().split()]
arr = [int(i) for i in input().strip().split()] + [k + arr[0]]
max_d = 0
for i in range(1, n + 1):
    max_d = max(max_d, abs(arr[i] - arr[i - 1]))
print(k - max_d)

### FIXED CODE ###

k, n = [int(i) for i in input().strip().split()]
arr = [int(i) for i in input().strip().split()]
arr += [k + arr[0]]
max_d = 0
for i in range(1, n + 1):
    max_d = max(max_d, abs(arr[i] - arr[i - 1]))
print(k - max_d)
C1=input()
C2=input()

if (C1[0]==C[2]) and (C1[0]==C2[2]) and (C1[1]==C2[1]):
  print("YES")
else:
  print("NO")

### FIXED CODE ###

C1=input()
C2=input()

if (C1[0]==C2[2]) and (C1[2]==C2[0]) and (C1[1]==C2[1]):
  print("YES")
else:
  print("NO")
import math
def combinations_count(n, r):
    if n-r<0:
        return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
mod=998244353
n,s=map(int,input().split())
a=list(map(int,input().split()))
dp=[dict() for i in range(s+1)]
for i in range(n):
    if a[i]<=s:
        if 1 in dp[a[i]]:
            dp[a[i]][1]+=1
        else:
            dp[a[i]][1]=1
for i in range(1,s+1):
    for k in range(i,s+1):
        if k+i<=s:
            if k!=i:
                for j in dp[i]:
                    if j+1 in dp[k+i]:
                        dp[k+i][j+1]+=dp[i][j]
                        dp[k+i][j+1]%=mod
                    else:
                        dp[k+i][j+1]=dp[i][j]
                        dp[k+i][j+1]%=mod
            else:
                for j in dp[i]:
                    if j==1:
                        if j+1 in dp[k+i]:
                            dp[k+i][j+1]+=combinations_count(dp[i][j],2)
                            dp[k+i][j+1]%=mod
                        else:
                            dp[k+i][j+1]=combinations_count(dp[i][j],2)
                            dp[k+i][j+1]%=mod
                    else:
                        if j+1 in dp[k+i]:
                            dp[k+i][j+1]+=dp[i][j]
                            dp[k+i][j+1]%=mod
                        else:
                            dp[k+i][j+1]=dp[i][j]
                            dp[k+i][j+1]%=mod

ans=0
for i in dp[s]:
    ans+=(pow(2,n-i,mod)*dp[s][i])
    ans%=mod
print(ans)

### FIXED CODE ###

mod=998244353
n,s=map(int,input().split())
a=list(map(int,input().split()))
dp=[[0]*(s+1) for i in range(n+1)]
dp[0][0]=1
for i in range(n):
    for j in range(s+1):
        if j-a[i]>=0:
            dp[i+1][j]=dp[i][j]*2+dp[i][j-a[i]]
        else:
            dp[i+1][j]=dp[i][j]*2
        dp[i+1][j]%=mod
print(dp[n][s])
N, X = map(int, input().split())
L = list(map(int, input().split()))

cnt = 0
m = 0
while m <= X:
    m += L[cnt]
    cnt += 1

print(cnt)

### FIXED CODE ###

N, X = map(int, input().split())
L = list(map(int, input().split()))
 
D = 0
cnt = 1
for i in range(N):
    D += L[i]
    if D <= X:
        cnt += 1
print(cnt)
import sympy

R = float(input())
2*sympy.pi.evalf(1000)*R

### FIXED CODE ###

import math
R = int(input())
print(2*math.pi*R)
h,w = map(int,input().split())
s = [list(input()) for _ in range(h)]
visited = [[False]*w for _ in range(h)]

def dfs(y,x):
    visited[y][x] = True
    blk, wht = 0,0
    for dy,dx in zip((-1,1,0,0),(0,0,-1,1)):
        ny,nx = y+dy, x+dx
        if (not (0<=ny<h)) or (not (0<=nx<w)) or visited[ny][nx]:
            continue
        if s[y][x]!=s[ny][nx]:
            nb,nw = dfs(ny,nx)
            blk += nb
            wht += nw
    if s[y][x]=='#':
        blk += 1
    else:
        wht += 1
    return blk, wht

ans = 0
for i in range(h):
    for j in range(w):
        if not visited[i][j]:
            blk, wht = dfs(i,j)
            ans += blk*wht
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
h,w = map(int,input().split())
s = [list(input()) for _ in range(h)]
visited = [[False]*w for _ in range(h)]

def dfs(y,x):
    visited[y][x] = True
    blk, wht = 0,0
    for dy,dx in zip((-1,1,0,0),(0,0,-1,1)):
        ny,nx = y+dy, x+dx
        if (not (0<=ny<h)) or (not (0<=nx<w)) or visited[ny][nx]:
            continue
        if s[y][x]!=s[ny][nx]:
            nb,nw = dfs(ny,nx)
            blk += nb
            wht += nw
    if s[y][x]=='#':
        blk += 1
    else:
        wht += 1
    return blk, wht

ans = 0
for i in range(h):
    for j in range(w):
        if not visited[i][j]:
            blk, wht = dfs(i,j)
            ans += blk*wht
print(ans)
import sys; sys.setrecursionlimit(50000)
input = sys.stdin.readline

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

cnt = 0
result = [0]*X*Y*Z
for x in range(X):
    for y in range(Y):
        if x * y > K: break
        for z in range(Z):
            if x * y * z > K: break
            result[cnt] = A[x]+B[y]+C[z]
            cnt += 1
result.sort(reverse=True)
for i in range(K):
    print(result[i])


### FIXED CODE ###

X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

import itertools
AB = [a + b for a, b in itertools.product(A,B)]
AB.sort(reverse=True)
ABC = [ab + c for ab, c in itertools.product(AB[:3000],C)]
ABC.sort(reverse=True)
for i in range(K):
    print(ABC[i])
n,k = map(int, input().split())

s = input()
s[k+1].lower()
print(s)

### FIXED CODE ###

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

s = input()

print(s[:k-1] + s[k-1].lower() + s[k:])
S = input()
T = input()
cnt = 0
for i in range(len(S)):
    if S[i] != T[i] :
        cnt += 1
prrint(cnt)

### FIXED CODE ###

S = input()
T = input()
cnt = 0
for i in range(len(S)):
    if S[i] != T[i] :
        cnt += 1
print(cnt)
import math
N, M = map(int, input().split())

if int(math.sqrt(M)) > N:
    divlist = []
    for i in range (N, int(math.sqrt(M))):
        if M%i == 0:
            divlist.append(i)
    
    if divlist != []:
        for i in range(N, int(math.sqrt(M))):
            if M%i == 0:
                ans = M//i
                break
    else:
        for i in range(N,0,-1):
            if M%i == 0:
                ans = i
                break
else:
    for i in range(M//N,0,-1):
        if M%i == 0:
            ans = i
            break
            
print(ans)

### FIXED CODE ###

G = int(input())
if G == 1:
    print('Hello World')
if G == 2:
    ANS = 0
    for i in range(2):
        ANS += int(input())
    print(ANS)
list = sorted(map(int,raw_input().split()))
strlist = map(str,list)
print strlist[0] + ' ' + strlist[1] + ' ' + strlist[2]

### FIXED CODE ###

a, b, c = sorted(input().split())
print(a, b, c)
n=int(input())
node=[-1 for i in range(n)]
g=[[] for i in range(n)]
def color(par,i,ini):
  if node[i]>-1:
    return
  else:
    if par==-1:
      node[i]=0
    else:
      node[i]=node[par]^ini
  for j in range(len(g[i])):
    color(i,g[i][j][0],g[i][j][1])
  return
for i in range(n-1):
  u,v,w=map(int,input().split())
  u-=1
  v-=1
  w%=2
  g[u].append([v,w])
  g[v].append([u,w])
color(-1,0,0)
for i in range(n):
  if node[i]==-1:
    node[i]=0
  print(node[i])

### FIXED CODE ###

n=int(input())
node=[-1 for i in range(n)]
g=[[] for i in range(n)]
for i in range(n-1):
  u,v,w=map(int,input().split())
  u-=1
  v-=1
  w%=2
  g[u].append([v,w])
  g[v].append([u,w])
queue=[0]
node[0]=0
while len(queue)>0:
  t=queue.pop()
  for v,w in g[t]:
    if node[v]>-1:
      continue
    node[v]=node[t]^w
    queue.append(v)
for i in range(n):
  print(node[i])
N, K, Q = map(int, input().split())
A = list(map(int, input().split()))

def getMinX(i, y):
    B = [[]]
    for j, a in enumerate(A):
        if i == j:
            continue
        if a < y and len(B[-1]) > 0:
            B.append([])
        if a >= y:
            B[-1].append(a)

    C = []
    for grp in B:
        grp.sort()
        C += grp[:len(grp) - K + 1]
    C.sort()
    return C[Q - 2] if len(C) >= Q - 1 else 10**18

ans = 10**18
for i, y in enumerate(A):
    ans = min(ans, getMinX(i, y) - y)
print(ans)

### FIXED CODE ###

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

def sol(y):
    B = [[]]
    for a in A:
        if a < y and len(B[-1]) > 0:
            B.append([])
        if a >= y:
            B[-1].append(a)

    C = []
    for grp in B:
        grp.sort()
        C += grp[:max(0, len(grp) - K + 1)]
    C.sort()

    return C[Q - 1] - y if len(C) >= Q and C[0] == y else 10**18

ans = 10**18
for y in A:
    ans = min(ans, sol(y))

print(ans)
a=list(input())
b=[]
for i in range(3):
  if a[i]==a[i+1]:
      b.append(0)
  else:
      b.append(1)
if b in 0:
    print('Bad')
else:
    print('Good')




### FIXED CODE ###

a=list(input())
if a[0]==a[1] or a[1]==a[2] or a[2]==a[3]:
  print('Bad')
else:
  print('Good')
def get_line():
  return input().split(' ')

class element:
  def __init__(self, P, Y, idx):
    self.P = P
    self.Y = Y
    self.idx = idx
  def __lt__(self, other):
    return self.Y < other.Y

N, M = map(int, get_line())
els = [0] * M
for i in range(M):
  p, y = map(int, get_line())
  els[i] = Element(p, y, i)

p_map = [[] for _ in range(N)]

for e in els:
  p_map[e.P - 1].append(e)

ans = [0] * M

for mp in p_map:
  cnt = 1
  for e in sorted(mp):
    ans[e.idx] = "{:06d}{:06d}".format(e.P, cnt)
    cnt = cnt + 1

for e in ans:
  print(e)


### FIXED CODE ###

def get_line():
  return input().split(' ')

class element:
  def __init__(self, P, Y, idx):
    self.P = P
    self.Y = Y
    self.idx = idx
  def __lt__(self, other):
    return self.Y < other.Y

N, M = map(int, get_line())
els = [0] * M
for i in range(M):
  p, y = map(int, get_line())
  els[i] = element(p, y, i)

p_map = [[] for _ in range(N)]

for e in els:
  p_map[e.P - 1].append(e)

ans = [0] * M

for mp in p_map:
  cnt = 1
  for e in sorted(mp):
    ans[e.idx] = "{:06d}{:06d}".format(e.P, cnt)
    cnt = cnt + 1

for e in ans:
  print(e)
a = input()
print(int(a+a*a+a*a*a))


### FIXED CODE ###

a = int(input())
print(a + a * a + a * a * a)
X, N = map(int, input().split())
p = list(map(int, input().split()))
not_in_p = list(range(1,101))
for pn in p:
    if pn in not_in_p:
        not_in_p.remove(pn)
diff_p=[]
for not_in_pn in not_in_p:
    diff_p.append(abs(not_in_pn - X))
index = diff_p.index(min(diff_p))
print(not_in_p[index])

### FIXED CODE ###

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

not_in_p = list(range(-101,102))
for pn in p:
    if pn in not_in_p:
        not_in_p.remove(pn)

diff_p = []
for not_in_pn in not_in_p:
    diff_p.append(abs(not_in_pn - X))
answer = not_in_p[diff_p.index(min(diff_p))]

print(answer)
a = input()
b = input()
c = ""
for i in range(len(a)):
  c = c + a[i] + b[i]
if len(a)>len(b):
  c = c + a[len(a)]
print(c)
  

### FIXED CODE ###

a = input()
b = input()
c = ""
for i in range(len(b)):
  c = c + a[i] + b[i]
if len(a)>len(b):
  c = c + a[len(a)-1]
print(c)
def c(x):
    if sb[x] + S <= k: return True
    else: return False


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

sa = []
sb = []

if a[0] <= k:
    sa.append(a[0])
    for i in range(1, n):
        if sa[i-1]+a[i] > k:
            break
        sa.append(sa[i-1]+a[i])

if b[0] <= k:
    sb.append(b[0])
    for j in range(1, m):
        if sb[j-1]+b[j] > k:
            break
        sb.append(sb[j-1]+b[j])

if len(sa) == 0:
    print(len(sb))
    exit()

ans = len(sa)

for i in range(len(sa))[::-1]:
    mb = 0
    lb = len(sb) - 1
    if len(sb) == 0 or sa[i] + sb[0] > k:
        print(len(sa))
        exit()
    
    while lb - mb > 1:
        mid = (mb+lb)//2
        if c(mid):
            mb = mid
        else:
            lb = mid
    ans = max(ans, i+1+lb)

print(ans)

### FIXED CODE ###

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

sa = [0]
sb = [0]

for i in range(n):
    sa.append(sa[i]+a[i])

for i in range(m):
    sb.append(sb[i]+b[i])

ans = 0
j = m

#しゃくとり
for i in range(n+1):
    if sa[i] > k:
        break
    while sa[i]+sb[j] > k:
        j -= 1
    ans = max(ans, i+j)

print(ans)
import sys
import numpy as np
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
X, Y, A, B, C = [int(x) for x in input().strip().split()]
p = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:X]
q = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:Y]
r = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:min(C, X+Y)]

pq = np.hstack((p, q, r))
pq.sort()
print(sum(pq[-(X+Y):]))

### FIXED CODE ###

import sys
import numpy as np
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
X, Y, A, B, C = [int(x) for x in input().strip().split()]
p = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:X]
q = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:Y]
r = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:min(C, X+Y)]

pq = np.hstack((p, q))
pq.sort()
ri = 0
for i, t in enumerate(pq):
    if t < r[ri]:
        pq[i] = r[ri]
        ri += 1
    if ri == len(r):
        break
print(sum(pq))
mport sys
fin = sys.stdin.readline

N, M = map(int, fin().split())
As = list(map(int, fin().split()))
BC = [tuple(map(int, fin().split())) for _ in range(M)]

As = sorted(As)
BC = sorted(BC, key=lambda x: x[1], reverse=True)


def f(As, num, val):
    count = 0
    for i in range(min(num, len(As))):
        if As[i] < val:
            count += 1
        else:
            break
    return val * count, As[count:]


sum__ = 0
for num, val in BC:
    sum_, As = f(As, num, val)
    sum__ += sum_

print(sum__ + sum(As))

### FIXED CODE ###

import sys

fin = sys.stdin.readline

N, M = map(int, fin().split())
As = list(map(int, fin().split()))
BC = [tuple(map(int, fin().split())) for _ in range(M)]

As = sorted(As)
# BC = sorted(BC, key=lambda x: x[1], reverse=True)

BC_ = {}
for num, val in BC:
    if val in BC_:
        BC_[val] += num
    else:
        BC_[val] = num

BC_ = sorted(BC_.items(), reverse=True)

#
# def f(a, n, v):
#     if a[min(n-1, len(a)-1)] < v:
#         return v * min(n, len(a)), a[n:]
#     count = 0
#     for i in range(min(n, len(a))):
#         if a[i] < v:
#             count += 1
#         else:
#             break
#     return v * count, a[count:]


sum__ = 0
now = 0
for val, num in BC_:
    if now >= len(As) or As[now] >= val:
        break

    if As[min(num - 1 + now, len(As) - 1)] < val:
        sum_ = val * min(num, len(As) - now)
        now += min(num, len(As) - now)
    else:
        count = 0
        for i in range(min(num, len(As)-now)):
            if As[i + now] < val:
                count += 1
            else:
                break
        sum_ = val * count
        now += count
    sum__ += sum_

print(sum__ + sum(As[now:]))
n, q = list(map(int, input().split()))
#n = 4
#q = 3

ans = [0]*(n-1)
ki = {}
for i in range(1,n+1):
    ki[i] = []

#z = ["1 2", "2 3", "2 4"]

for i in range(n-1):
    e = list(map(int, input().split()))
    #e = list(map(int, z[i].split()))
    ki[e[0]].append(e[1])

#print(ki)

def df(graph, start, point):
    stack = [start]
    visited = []
    while stack:
        v = stack.pop(0)
        ans[v - 1] += point
        if v not in visited:
            visited.append(v)
            stack = graph.get(v, []) + stack

#y = ["2 10", "1 100", "3 1"]
for i in range(q):
    p = list(map(int, input().split()))
    #p = list(map(int, y[i].split()))
    df(ki, p[0], p[1])

for n in ans:
    print(n, end=" ")



### FIXED CODE ###

import sys

def main():
    sys.setrecursionlimit(10**6)
    input = sys.stdin.readline
    n, q = map(int, input().split())
    #n, q = map(int, "4 3".split())
    g = [[] for _ in range(n)]
    for i in range(n-1):
        a, b = map(int, input().split())
        #a, b = map(int, ["1 2", "2 3", "2 4"][i].split())
        g[a-1].append(b-1)
        g[b-1].append(a-1)


    add = [0] * n
    for i in range(q):
        p, v = map(int, input().split())
        #p, v = map(int, ["2 10", "1 100", "3 1"][i].split())
        #dfs(p-1, v)
        add[p-1] += v

    ans = [0] * n
    def dfs(v,p,value): #p: parent of v
        value += add[v]
        ans[v] = value
        for c in g[v]:
            if c == p: continue
            dfs(c,v,value)
    dfs(0, -1, 0)
    """
    def dfs(start, point):
        stack = [start]
        while stack:
            x = stack.pop()
            ans[x] += point
            stack += g[x]
    """

    print(' '.join(map(str, ans)))

if __name__ == '__main__':
    main()
K, N = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]

a = [A[i]-A[i-1] for i in range(1,N-1)]

b = A[0]+(K-A[N-1])

print(K-max(a,b))


### FIXED CODE ###

k,n = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
c = a[0] + (k - a[n-1])
for i in range(1,n):
  c = max(c,a[i] - a[i-1])
print(k-c)
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e - a <= k:
    print('Yay!')
else:
    print(':(')


### FIXED CODE ###

b = str(input())
if b == 'A':
    print('T')
elif b == 'C':
    print('G')
elif b == 'G':
    print('C')
else:
    print('A')
n, m = map(int, input().split())
dp = [0]*(n+1)
dp[0] = 1
m_list = [int(input()) for _ in range(m)]
for i in range(1,n+1):
  if i==1:
    if i==m_list[0]:
      m_list.pop(0)
      dp[i]=0
    else:
      dp[i]=1
  elif m_list and i == m_list[0]:
    m_list.pop(0)
    dp[i] = 0
  else:
    dp[i] = (dp[i-1]+dp[i-2])% 1000000007
print(dp[-1])

### FIXED CODE ###

n, m = map(int, input().split())
dp = [0]*(n+1)
dp[0] = 1
m_list = [int(input()) for _ in range(m)]
for i in range(1,n+1):
  if i==1:
    if m_list and i==m_list[0]:
      m_list.pop(0)
      dp[i]=0
    else:
      dp[i]=1
  elif m_list and i == m_list[0]:
    m_list.pop(0)
    dp[i] = 0
  else:
    dp[i] = (dp[i-1]+dp[i-2])% 1000000007
print(dp[-1])
#!/usr/bin/env pypy3

import math, itertools, operator
from math import *
from math import factorial as fact
from itertools import permutations, combinations
from functools import reduce
from statistics import mean, median, median_low, median_high, mode
# Before Python 3.5
from fractions import gcd

#import numpy
#import scipy, scipy.special
#from sympy import isprime, nextprime
#from sympy.ntheory import factorint

inf = float('inf')

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

def perm(a, b):
    import scipy.special
    return scipy.special.perm(a, b, exact = True)

def comb(a, b):
    import scipy.special
    return scipy.special.comb(a, b, exact = True)

def dfact(n):
    import scipy.special
    return scipy.special.factorial2(n, exact = True)

def prod(l):
    return reduce(operator.mul, l)

def input_ints(inp = input, sep = ' ', conv = int):
    return map(conv, inp().split(sep = sep))

################################################################################


N, K = input_ints()

print(N-K+1)


### FIXED CODE ###

#!/usr/bin/env pypy3

import math, itertools, operator
from math import *
from math import factorial as fact
from itertools import permutations, combinations
from functools import reduce
from statistics import mean, median, median_low, median_high, mode
# Before Python 3.5
from fractions import gcd

#import numpy
#import scipy, scipy.special
#from sympy import isprime, nextprime
#from sympy.ntheory import factorint

inf = float('inf')

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

def perm(a, b):
    import scipy.special
    return scipy.special.perm(a, b, exact = True)

def comb(a, b):
    import scipy.special
    return scipy.special.comb(a, b, exact = True)

def dfact(n):
    import scipy.special
    return scipy.special.factorial2(n, exact = True)

def prod(l):
    return reduce(operator.mul, l)

def input_ints(inp = input, sep = ' ', conv = int):
    return map(conv, inp().split(sep = sep))

################################################################################


N, K = input_ints()

print(N-K+1)
a.b = map(int, input().split())
print(a+b if a+b<10 else "error")

### FIXED CODE ###

a,b = map(int, input().split())
print(a+b if a+b<10 else "error")
#-*- using:utf-8 -*-

def euclidean(a,b):
    if b == 0:
        return a
    else:
        return  euclidean(b,a%b)

def gcd(a,b):
#    print("gcd %d %d" %(a,b))
    n = 0
    if a == b:
        return a
    elif a > b:
        n = euclidean(a,b)

    elif a < b:
        n = euclidean(b,a)

    else:
        pass

    return n

def left(i,a):
    cd = 0
    for p in range(i):
        #cd0 = left(0) = 0
        #cd1 = left(1) = gcd(cd0,a[0])
        #cd2 = left(2) = gcd(cd1,a[1])
#        print("left %d %d" %(cd,a[p]))
        cd = gcd(cd,a[p])
#        print("left %d" %cd)
    return cd

def right(i,a):
    cd = 0
    for p in range(i,m)[::-1]:
        #cdn+1 = right(n+1) = 0
        #cdn   = right(n)   = gcd(cdn+1,a[n])
        #cdn-1 = right(n-1) = gcd(cdn,a[n-1])
#        print("right %d %d" %(cd,a[p]))
        cd = gcd(cd,a[p])
#        print("right %d" %cd)
    return cd

def blackboard(n,a):
    candidate = 0
    maxnum = 0
    b = list(map(int,a))

    p = m // 2 # round down
    q = -(-m // 2) #round up
#    print("i %d j %d" %(p,q))
    maxnum = gcd(left(p,b),right(q,b))

    return maxnum
  
  if __name__ == '__main__':
    n = raw_input()
    a = raw_input().split()
    global m
    m = int(n)
    print("%d" %(blackboard(m,a)))

### FIXED CODE ###

#-*- using:utf-8 -*-
def euclidean(a,b):
    if b == 0:
        return a
    else:
        return  euclidean(b,a%b)

def gcd(a,b):
#    print("gcd %d %d" %(a,b))
    n = 0
    if a == b:
        return a
    elif a > b:
        n = euclidean(a,b)

    elif a < b:
        n = euclidean(b,a)

    else:
        pass

    return n

def blackboard(n,a):
    candidate = 0
    maxnum = 0
    b = list(map(int,a))

    left = [0] * (n+1)
    right = [0] * (n+1)
    for i in range(n):
        left[i+1] = gcd(left[i],b[i])
        right[i+1] = gcd(right[i],b[n - i -1])

    for i in range(n):
        candidate = gcd(left[i],right[n-i-1])
        if candidate > maxnum:
            maxnum = candidate

    return maxnum


if __name__ == '__main__':
    n = raw_input()
    a = raw_input().split()
    m = int(n)
    print("%d" %(blackboard(m,a)))