Harryxun/stf_run huggingface dataset:
import functools
from math import gcd
N = int(input())
A = list(map(int, input().split()))
MAX = 10 * 6 + 10

prime_list = [i for i in range(MAX + 1)]
p = 2
while p * p <= MAX:
    if prime_list[p] == p:
        for q in range(2*p, MAX+1, p):
            if prime_list[q] == q:
                prime_list[q] = p
    p += 1

prime = set()
cnt = 0
for a in A:
    tmp = set()
    while a > 1:
        tmp.add(prime_list[a])
        a //= prime_list[a]
    prime = prime | tmp
    cnt += len(tmp)

if len(prime) == cnt:
    print("pairwise coprime")
elif functools.reduce(gcd, A) == 1:
    print("setwise coprime")
else:
    print("not coprime")


### FIXED CODE ###

import functools
from math import gcd
N = int(input())
A = list(map(int, input().split()))
MAX = 10 ** 6 + 10

if functools.reduce(gcd, A) != 1:
    print("not coprime")
    exit()

prime_list = [i for i in range(MAX + 1)]
p = 2
while p * p <= MAX:
    if prime_list[p] == p:
        for q in range(2*p, MAX+1, p):
            if prime_list[q] == q:
                prime_list[q] = p
    p += 1

prime = set()
for a in A:
    tmp = set()
    while a > 1:
        tmp.add(prime_list[a])
        a //= prime_list[a]
    for p in tmp:
        if p in prime:
            print("setwise coprime")
            exit()
        prime.add(p)
else:
    print("pairwise coprime")
a = int(input())
b = int(input())


cnt = 0
for i in range(a, b+1):
    ii = str(i)
    if ii[0] == ii[4] and ii[1] == ii[3]:
        cnt += 1

print(cnt)


### FIXED CODE ###

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

cnt = 0
for i in range(a, b+1):
    ii = str(i)
    if ii[0] == ii[4] and ii[1] == ii[3]:
        cnt += 1

print(cnt)
a=map(int,input().split())
print("YES" if a[0)+a[1]>=a[3] else "NO")

### FIXED CODE ###

a,b,c=map(int,input().split())
print("Yes" if a+b>=c else "No")
# encoding: utf-8
import math
N, M = map(int, input().split())

def distribute(pos, full, tmp):
    return memo[tmp][pos]

# define search range
p_max = int(M / 2) # M is prime if M has a factor p (> p_max)
ip_max = int(math.log2(M))

M_tmp = M
ips = []
for p in range(2, p_max + 1):
    # how many times M_tmp can be divided
    p_tmp = p
    for i_p in range(ip_max + 1):
        if M_tmp % p_tmp > 0: break
        p_tmp = p_tmp * p
    # escape if M_tmp cannot be divided
    if i_p < 1: continue
    # calculate later
    ips.append(i_p)
    # next
    M_tmp = M_tmp // (p_tmp // p)
    if M_tmp == 1: break

# create memo
## init
ip_max = max(ips)
memo = [[None] * N for i in range(ip_max + 1)] # max ip
for j in range(N): memo[0][j] = 1
for i in range(1, ip_max + 1): memo[i][N - 1] = 1
## fill
for i in range(1, ip_max + 1):
    sum_tmp = 1
    vals = list(memo[i - 1])[::-1]
    p_memo = memo[i]
    for j, val in enumerate(vals[1:]):
        sum_tmp += val
        p_memo[N - 2 - j] = sum_tmp

# calculate ans
ans = 1
for i_p in ips: ans = (ans * distribute(0, i_p, i_p)) % (10 ** 9 + 7) # oh...
    
print(ans)


### FIXED CODE ###

# encoding: utf-8
import math
N, M = map(int, input().split())

ips = []
M_tmp = M
for p in range(2, int(math.sqrt(M)) + 1):
    if M_tmp % p > 0: continue
    for i_p in range(1, 33):
        if M_tmp % (p ** (i_p + 1)) > 0: break
    ips.append(i_p)
    M_tmp = M_tmp // (p ** i_p)
    if M_tmp == 1: break
else:
    ips.append(1)

#### O(NlogM) below ?
# create memo
## init
if len(ips) > 0: ip_max = max(ips)
else: ip_max = 0
memo = [[None] * N for i in range(ip_max + 1)] # max ip
for j in range(N): memo[0][j] = 1
for i in range(1, ip_max + 1): memo[i][N - 1] = 1
## fill
for i in range(1, ip_max + 1):
    sum_tmp = 0
    vals = list(memo[i - 1])[::-1]
    ptr_memo = memo[i]
    for j, val in enumerate(vals):
        sum_tmp += val
        ptr_memo[N - 1 - j] = sum_tmp
#### O(NlogM) above ?
        
# calculate ans
ans = 1
for i_p in ips:
    ans = (ans * memo[i_p][0]) % (10 ** 9 + 7)

if M == 1: print(1)
elif ip_max < 1: print(N)
else: print(ans)
n = input()
li = list(map(int, input().split()))
a = 1
if 0 in li:
    print(0)
else:
    for x in li:
    a *= x
    if a > 10**18:
        print(-1)
    else:
        print(a)

### FIXED CODE ###

n = int(input())
ls = list(map(int, input().split()))
res = 1
if 0 in ls:
    print(0)
    quit()
for x in ls:
    res *= x
    if res > 10**18:
        print(-1)
        quit()
print(res)
N,A,B = map(int,input().split())
if A ==0 :
    print(0)
elif B==0:
    print(N)
else:
    m = N % (A+B)
    n = N // (A+B)
    ans = A * n
    if m > A:
        print(ans+A)
    else:
        print(ans+m)



### FIXED CODE ###

S = list(input())
if S[0]  == "A" and S[1]  == "A" and S[2]  == "A":
  print("No")
elif S[0]  == "B" and S[1]  == "B" and S[2]  == "B":
  print("No")
else:
  print("Yes")
n = int(input())
k = int(input())
x = int(input())
y = int(input())

print(x*n-max((x-y)*(n-k),0))


### FIXED CODE ###

n = int(input())
ans = 0
for i in range(1,n+1):
  ans += i

print(ans)
n = int(input())
s = str(input())

R = []
G = []
B = []
for i in range(n):
  if s[i] == "R":
    R.append(i+1)
  elif s[i] == "G":
    G.append(i+1)
  else:
    B.append(i+1)

  
ans = 0

for i in range(len(R)):
  for j in range(len(G)):
    test += len(B)
    temp = 0
    if 2*R[i] - G[j] >0 and 2*R[i] - G[j] <= n:
      if s[2*R[i] - G[j] -1] == "B":
        temp += 1
    if 2*G[j] - R[i] >0 and 2*G[j] - R[i] <= n:
      if s[2*G[j] - R[i]-1] == "B":
        temp += 1
    if (R[i]+G[j])%2 == 0:
      if s[(R[i]+G[j])//2-1] == "B":
        temp += 1
    ans += len(B)- temp

print(ans)

### FIXED CODE ###

n = int(input())
s = str(input())

R = []
G = []
B = []
for i in range(n):
  if s[i] == "R":
    R.append(i+1)
  elif s[i] == "G":
    G.append(i+1)
  else:
    B.append(i+1)

  
ans = 0

for i in range(len(R)):
  for j in range(len(G)):
    temp = 0
    if 2*R[i] - G[j] >0 and 2*R[i] - G[j] <= n:
      if s[2*R[i] - G[j] -1] == "B":
        temp += 1
    if 2*G[j] - R[i] >0 and 2*G[j] - R[i] <= n:
      if s[2*G[j] - R[i]-1] == "B":
        temp += 1
    if (R[i]+G[j])%2 == 0:
      if s[(R[i]+G[j])//2-1] == "B":
        temp += 1
    ans += len(B)- temp

print(ans)
class UnionFind():
    def __init__(self, n):
        self.n = n
        # 親の名(いない場合はNone)
        self.parent = [None] * n
        # 子の数
        self.count = [0] * n

    def root(self, x):
        # xの根を返す
        if self.parent[x] is None:
            return x
        else:
            return self.root(self.parent[x])

    def union(self, x, y):
        # xとyをまとめる
        x0 = self.root(x)
        y0 = self.root(y)
        if x0 == y0:
            return
        if x0 > y0:
            x0, y0 = y0, x0
        self.parent[y0] = x0
        self.count[x0] += self.count[y0] + 1

    def size(self, x):
        # xの属する木の大きさ
        return self.count[self.root(x)] + 1

    def same(self, x, y):
        return self.root(x) == self.root(y)


n, m = map(int, input().split())
uf = UnionFind(n)
for i in range(m):
    a, b = map(int, input().split())
    uf.union(a - 1, b - 1)
maxSize = 0
for i in range(n):
    maxSize = max(maxSize, uf.size(i))
print(maxSize)


### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r))
                         for r in self.roots())


n, m = map(int, input().split())
uf = UnionFind(n)
for i in range(m):
    a, b = map(int, input().split())
    uf.union(a - 1, b - 1)
maxSize = 0
for j in range(n):
    maxSize = max(maxSize, uf.size(j))
print(maxSize)
a,b = input().split()
#print(a)
#print(b)

if a>8 or b>8:
    print(':(')
else:
  print('Yay!')




### FIXED CODE ###

a,b = input().split()
#print(a)
#print(b)

if int(a)>8 or int(b)>8:
    print(':(')
else:
    print('Yay!')
import math
N = int(input())
x = [0 for i in range(N)]
y = [0 for i in range(N)]
for i in range(N):
    x[i], y[i] = map(int, input().split())


def mindis(t):
    j = 0
    for i in range(N):
        if x[i]*math.sin(t)+y[i]*math.cos(t)<x[j]*math.sin(t)+y[i]*math.cos(t):
            j = i
    return j


r = [0 for i in range(N)]
M = 2500000
for i in range(M):
    k = mindis(2*math.pi*i/M)
    r[k] += 1
S = sum(r)
for i in range(N):
    print(r[i]/S)


### FIXED CODE ###

N = input()


def digitsum(n):
    s = str(n)
    S = 0
    for i in s:
        S += int(i)
    return S


d = len(str(N)) - 1
k = int(N[0])
print(max([digitsum(N),digitsum((k*10**d)-1)]))
n = int(input())
l = sorted(list(map(int,input().split())))
s = 0

for i in l[:-1]:
  s += i
  
if l[0] < s:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

t,x = map(int,input().split())
print(float(t/x))
A, op, B = input().split()
if op = '-':
  print(A - B)
else:
  print(A + B)

### FIXED CODE ###

A, op, B = input().split()
if op == '-':
  print(int(A) - int(B))
else:
  print(int(A) + int(B))
N = int(input())
nums = list(map(int, input().split()))
 
multi = reduce(mul, nums)
n = 0
while multi % 2 == 0:
  nums = [i/2 for i in nums]
  multi = reduce(mul, nums)
  n += 1

print(n)

### FIXED CODE ###

def how_many_times_divisible(n):
	ans = 0
	while n % 2 == 0:
		n /= 2
		ans += 1
	return ans

n = int(input())
a = map(int, input().split())
ans = min(map(how_many_times_divisible, a))

print(ans)
A = int(input())
B = int(input())

if A == 1 and B ==2:
  return 3
elif A == 1 and B ==3:
  return 2
elif A == 2 and B ==1:
  return 3
elif A == 2 and B ==3:
  return 1
elif A == 3 and B ==1:
  return 2
else:
  return 1

### FIXED CODE ###

A = int(input())
B = int(input())
 
if A == 1 and B ==2:
  print(3)
elif A == 1 and B ==3:
  print(2)
elif A == 2 and B ==1:
  print(3)
elif A == 2 and B ==3:
  print(1)
elif A == 3 and B ==1:
  print(2)
else:
  print(1)
a,b = map(int, input().split())
c = a * b
if c % 2:
    print("Odd")
else:
    print("Even")


### FIXED CODE ###

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

while True:
    for num, a in enumerate(A):
        if a % 2:
            print(cnt)
            break
        else:
            A[num] = a / 2
    if a % 2:
        break
    cnt += 1
import sys
n = int(input())
for i in range(int(n**0.5), 0, -1):
    if n%i==0:
        j=n//i
        print(i+j-2)
        sys.exit()

### FIXED CODE ###

a, b = map(int, input().split())
n = a*b
if a > 9 or b > 9:
  print(-1)
else:
  print(n)
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 28 16:53:54 2019

@author: またの
"""

N,M=map(int,input().split())
L = []
for i in range(N):
    L.append(list(map(int,input().split())))

K1=[]
K2=[]
K3=[]
K4=[]
K5=[]
K6=[]
K7=[]
K8=[]

C = [0,0,0,0,0,0,0,0]

for i in range(N):
    K1.append(L[i][0]+L[i][1]+L[i][2])
K1.sort()

for i in range(N):
    K2.append(L[i][0]-L[i][1]+L[i][2])
K2.sort()

for i in range(N):
    K3.append(L[i][0]+L[i][1]-L[i][2])
K3.sort()

for i in range(N):
    K4.append(-L[i][0]+L[i][1]+L[i][2])
K4.sort()

for i in range(N):
    K5.append(-L[i][0]+L[i][1]-L[i][2])
K5.sort()

for i in range(N):
    K6.append(L[i][0]-L[i][1]-L[i][2])
K6.sort()

for i in range(N):
    K7.append(-L[i][0]-L[i][1]+L[i][2])
K7.sort()

for i in range(N):
    K8.append(-L[i][0]-L[i][1]-L[i][2])
K8.sort()

for i in range(M):
    C[0] += K1[N-i]
    C[1] += K2[N-i]
    C[2] += K3[N-i]
    C[3] += K4[N-i]
    C[4] += K5[N-i]
    C[5] += K6[N-i]
    C[6] += K7[N-i]
    C[7] += K8[N-i]
    
for i in range(8):
    C[i] = abs(C[i])
print(max(C))


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Thu Feb 28 16:53:54 2019

@author: またの
"""

N,M=map(int,input().split())
L = []
for i in range(N):
    L.append(list(map(int,input().split())))

K1=[]
K2=[]
K3=[]
K4=[]
K5=[]
K6=[]
K7=[]
K8=[]

C = [0,0,0,0,0,0,0,0]

for i in range(N):
    K1.append(L[i][0]+L[i][1]+L[i][2])
K1.sort()

for i in range(N):
    K2.append(L[i][0]-L[i][1]+L[i][2])
K2.sort()

for i in range(N):
    K3.append(L[i][0]+L[i][1]-L[i][2])
K3.sort()

for i in range(N):
    K4.append(-L[i][0]+L[i][1]+L[i][2])
K4.sort()

for i in range(N):
    K5.append(-L[i][0]+L[i][1]-L[i][2])
K5.sort()

for i in range(N):
    K6.append(L[i][0]-L[i][1]-L[i][2])
K6.sort()

for i in range(N):
    K7.append(-L[i][0]-L[i][1]+L[i][2])
K7.sort()

for i in range(N):
    K8.append(-L[i][0]-L[i][1]-L[i][2])
K8.sort()

for i in range(M):
    C[0] += K1[N-i-1]
    C[1] += K2[N-i-1]
    C[2] += K3[N-i-1]
    C[3] += K4[N-i-1]
    C[4] += K5[N-i-1]
    C[5] += K6[N-i-1]
    C[6] += K7[N-i-1]
    C[7] += K8[N-i-1]
    
for i in range(8):
    C[i] = abs(C[i])
print(max(C))
n,q = raw_input()
A,m = map(int, raw_input().split())
 
def ans(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res
 
for m in M:
  if solve(0,m):
     print "yes"
  else:
     print "no"

### FIXED CODE ###

def ans(n, AA, x):
    tmp = n + AA[0]
    if len(AA) == 1:
        try: x[tmp] = 1
        except: pass
    else:
        ans(n, AA[1:], x)
        try:
            x[tmp] = 1
            ans(tmp, AA[1:],x)
        except:
            pass
    return
 
n = raw_input()
A = map(int, raw_input().split())
q = raw_input()
M = map(int, raw_input().split())
 
x = [0 for i in range(max(M)+1)]
ans(0, A, x)
 
for e in M:
    if x[e] == 1:
        print 'yes'
    else:
        print 'no'
L ,R = map(int,input().split())

ans =[]
if R - L <= 2019:
    for i in range(L,R+1):
        for j in range(i+1,R+1):
            ans.append(i*j%2019)
            if i*j% 2019== 0 :
                exit()

print(min(ans))


### FIXED CODE ###

L ,R = map(int,input().split())

ans =[]
if R - L <= 2019:
    for i in range(L,R+1):
        for j in range(i+1,R+1):
            ans.append(i*j%2019)

else:
    for i in range(R-L-1010,R-L+1010):
        for j in range(i,R-L+1010):
            ans.append(i*j%2019)

print(min(ans))
def solve():
  N = int(input())
  M = (N - 2) * 2
  for i in range(3, N + 1):
    print(f'1 {i}\n{i - 1} {i}')

solve()


### FIXED CODE ###

N = int(input())

def solve(N):
  fmt = '{} {}'
  ans = []
  sub = []
  if N % 2 == 1:
    ans = solve(N - 1)
    for i in range(1, N):
      ans.append(fmt.format(i, N))
  else:
    for i in range(1, N + 1):
      for j in range(i + 1, N + 1):
        if j == N - i + 1: continue
        ans.append(fmt.format(i, j))
  return ans

ans = solve(N)
print(len(ans))
[print(a) for a in ans]
from collections import deque

N, M, K = [int(n) for n in input().split()]
desk_a = deque([int(n) for n in input().split()], maxlen=200001)
desk_b = deque([int(n) for n in input().split()], maxlen=200001)

def max_n_book(desk_a, desk_b, count=0, k=K):
    if k < 0:
        return count - 1
    if len(desk_a) != 0:
        book_a = desk_a.popleft()
        # count_a = max_n_book(desk_a, desk_b, count=count+1, k=k-book_a)
        count_a = 0
    else:
        count_a = count
    if len(desk_b) != 0:
        book_b = desk_b.popleft()
        # count_b = max_n_book(desk_b, desk_b, count=count+1, k=k-book_b)
        count_a = 0
    else:
        count_b = count
    return max(count_a, count_b)

n_book = max_n_book(desk_a, desk_b, count=0, k=K)
print(n_book)


### FIXED CODE ###

N, M, K = map(int, input().split())
desk_a = list(map(int, input().split()))
desk_b = list(map(int, input().split()))

sum_a = [0]
sum_b = [0]

for i in range(N):
    sum_a.append(sum_a[-1] + desk_a[i])
for i in range(M):
    sum_b.append(sum_b[-1] + desk_b[i])

ans = 0
j = M
for i in range(N+1): 
    a = sum_a[i]
    if K - a < 0:
        break
    while sum_b[j] > K - a: 
        j -= 1
    ans = max(ans, i+j)

print(ans)
A, B = map(int, input().split())
print("Yes" if A==B else "No)

### FIXED CODE ###

N, M = map(int, input().split())
if N == M:
  print("Yes")
else:
  print("No")
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(sys.stdin.readline())
def ria(): return list(map(int, sys.stdin.readline().split()))
def ws(s): sys.stdout.write(s); sys.stdout.write('\n')
def wi(n): sys.stdout.write(str(n)); sys.stdout.write('\n')
def wia(a, sep=' '): sys.stdout.write(sep.join([str(x) for x in a])); sys.stdout.write('\n')


def main():
    n = ri()
    x = rs()

    k = int(x, 2)
    d = x.count('1')
    if d > 0:
        k0 = k % (d-1)
    k1 = k % (d+1)

    f = [0] * (n + 1)
    for i in range(1, n+1):
        f[i] = f[i % bin(i).count('1')] + 1

    for i in range(n):
        if x[i] == '1':
            dd = d - 1
            if dd == 0:
                wi(0)
                continue
            wi(f[(k0 - pow(2, n - i - 1, dd)) % n] + 1)
        else:
            dd = d + 1
            wi(f[(k1 + pow(2, n - i - 1, dd)) % n] + 1)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(sys.stdin.readline())
def ria(): return list(map(int, sys.stdin.readline().split()))
def ws(s): sys.stdout.write(s); sys.stdout.write('\n')
def wi(n): sys.stdout.write(str(n)); sys.stdout.write('\n')
def wia(a, sep=' '): sys.stdout.write(sep.join([str(x) for x in a])); sys.stdout.write('\n')


def main():
    n = ri()
    x = rs()

    k = int(x, 2)
    d = x.count('1')
    
    if d > 1:
        k0 = k % (d-1)
    k1 = k % (d+1)

    f = [0] * (n + 1)
    for i in range(1, n+1):
        f[i] = f[i % bin(i).count('1')] + 1

    for i in range(n):
        cnt = 0
        if x[i] == '1' and d - 1 > 0:
            cnt += f[(k0 - pow(2, n - i - 1, d - 1)) % (d - 1)] + 1
        elif x[i] == '0':
            cnt += f[(k1 + pow(2, n - i - 1, d + 1)) % (d + 1)] + 1
        wi(cnt)


if __name__ == '__main__':
    main()
def solve(s):
    if len(s)<=1:
        return 0
    return (s[0]!=s[1]) + solve(s[1:])

S = input()
print(solve(S))

### FIXED CODE ###

def solve(s):
    ans = 0
    while len(s)>1:
        ans += s[0]!=s[1]
        s = s[1:]
    return ans

S = input()
print(solve(S))
import collections
N = int(input())
a = []
s = 0
for i in range(N):
    a.append(int(input()))
    s += a[i]

if N >= 2:
    if s == N or s == len(collections.Counter(a)):
        if s % 2 ==0:
            re = 'second'
        else:
            re = 'first'
    else:
        a.sort()
        diff = a[-1] - a[-2]
        if diff > 0:
            if diff % 2 == 0:
                re = 'second'
            else:
                re = 'first'
else:
    if a[0] % 2==0:
        re = 'second'
    else:
        re = 'first'
    
print(re)

### FIXED CODE ###

N = int(input())
a = []
s = 0
for i in range(N):
    a.append(int(input()))
    if a[i] % 2 == 0:
        s += 1
        
if s == N:
    re = 'second'
else:
    re = 'first'
    
print(re)
import math
 
def main ():
  a,b = list(input().split())
  c = int(a)
  d = float(b)
  e = d * 100
  c *= e
  c /= 100
  c = math.floor(c)
  print(ac)
 
main()

### FIXED CODE ###

import decimal
 
def main ():
  a,b = list(input().split())
  a = decimal.Decimal(a)
  b = decimal.Decimal(b)
  print(int(a * b))
 
main()
from math import factorial
N = int(input())
A = sorted(list(map(int, input().split())))
ret = []

pos = 1
maxn = 0
for i, a in enumerate(A):
    if a == 0:
        maxn = 1
        ans = (a, A[pos])
        continue
    minn = [abs(A[pos] / a - 2), (a, A[pos])]
    while pos < N:
        if minn[0] < abs(A[pos] / a - 2):
            break
        minn[0] = abs(A[pos] / a - 2)
        pos += 1
    if maxn < factorial(minn[1][1]) / factorial(minn[1][0]):
        maxn = factorial(minn[1][1]) / factorial(minn[1][0])
        ans = minn[1]
    if i == pos:
        pos += 1
    if pos >= N:
        break
print(ans[1], ans[0])


### FIXED CODE ###

N = int(input())
A = sorted(list(map(int, input().split())))
y = A.pop(-1)
print(y, min(A, key=lambda x: abs(y - 2 * x)))
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    C=[]
    
    #連番無視
    for i in range(N):
        c=I()
        c-=1
        if C==[]:
            C.append(c)
        else:
            if C[-1]!=c:
                C.append(c)         
            
    """
    i番目の通り数をf(i)とする．
    今，i番目までを見てて，i番目と同じ数はj,kにあるとする．
    f(i)=
         f(i-1) #iを使わない
        +f(j-1) #i-jのみ
        +f(k-1) #i-kのみ
    かな，各色ごとに，f(j-1)+f(k-1)みたいなのをまとめておく
    """    
    S=[0]*N
    
    ans=1
    for c in C:
        temp=ans
        ans=(ans+S[c])%mod
        S[c]=(S[c]+temp)%mod
        
    print(ans)
        
        
        
        
    

main()


### FIXED CODE ###

import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    C=[]
    
    #連番無視
    for i in range(N):
        c=I()
        c-=1
        if C==[]:
            C.append(c)
        else:
            if C[-1]!=c:
                C.append(c)         
            
    """
    i番目の通り数をf(i)とする．
    今，i番目までを見てて，i番目と同じ数はj,kにあるとする．
    f(i)=
         f(i-1) #iを使わない
        +f(j-1) #i-jのみ
        +f(k-1) #i-kのみ
    かな，各色ごとに，f(j-1)+f(k-1)みたいなのをまとめておく
    """    
    S=[0]*(2*10**5 + 5)
    
    ans=1
    for c in C:
        temp=ans
        ans=(ans+S[c])%mod
        S[c]=(S[c]+temp)%mod
        
    print(ans)
        
        
        
        
    

main()
import math

def lcm(x,y):
    return (x*y)//math.gcd(x,y)

def div_num(a,x,y):
    return a//x + a//y - a//lcm(x,y)

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

ans = (b-a+1) - ( div_num(b,c,d) - div_num(a-1,c,d) )

print(ans)

### FIXED CODE ###

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

def lcm(x,y):
    return (x*y) // gcd(x,y)

def div_num(a,x,y):
    return a//x + a//y - a//lcm(x,y)

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

ans = (b-a+1) - ( div_num(b,c,d) - div_num((a-1),c,d) )

print(ans)
import numpy as np
from sys import stdin
sys.setrecursionlimit(10**6) 

def main(args):
    a = int(args[0])
    b = int(args[1])
    if 6 <= a and a <= 12:
        v = b//2
    elif a <= 5:
        v = 0
    else:
        v = b
    print(v)

main(stdin.readline().rstrip().split())

### FIXED CODE ###

import numpy as np
from sys import stdin
#sys.setrecursionlimit(10**6) 

def main():
    a, b = [int(x) for x in stdin.readline().rstrip().split()]
    if 6 <= a and a <= 12:
        v = b//2
    elif a <= 5:
        v = 0
    else:
        v = b
    print(v)

if __name__ == "__main__":
    main()
a, b = map(int, input().split())

for n in range(0, 10000):
  a2 = int(n * 8 / 100)
  b2 = int(n * 8 / 100)
  if a2 == a and b2 == b:
    print(n)
    exit()

### FIXED CODE ###

a = input()

if 'A' in a and 'B' in a:
    print('Yes')
else:
    print('No')