Harryxun/stf_run huggingface dataset:
from math import gcd
from sys import stdin
from functools import reduce


def main():
    _ = int(stdin.readline().rstrip())
    As = [int(x) for x in stdin.readline().rstrip().split()]
    max_ = 0
    for a in As:
        tmp = As[:]
        tmp.remove(a)
        max_ = max(max_, reduce(gcd, tmp))
    print(max_)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from functools import lru_cache
from sys import stdin


@lru_cache(maxsize=None)
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def make_acc_gdbs(As):
    result = []
    tmp = 0
    for x in As:
        tmp = gcd(tmp, x)
        result.append(tmp)
    return result


def main():
    N = int(stdin.readline().rstrip())
    As = [int(x) for x in stdin.readline().rstrip().split()]
    lAs = make_acc_gdbs(As)
    rAs = make_acc_gdbs(As[::-1])[::-1]
    max_ = 0
    for i in range(N):
        left = 0 if i == 0 else lAs[i - 1]
        right = 0 if i == (N - 1) else rAs[i + 1]
        max_ = max(max_, gcd(left, right))
    print(max_)


if __name__ == "__main__":
    main()
from heapq import*
(N,M),*t=[map(int,s.split())for s in open(0)]
z,*q=[0]*9*M
v=[[]for _ in q]
for a,b in t:v[a-1]+=b,
for i in v[:M]:
 for j in i:heappush(q,-j)
 z-=heappop(q)
print(z)

### FIXED CODE ###

from collections import*
from heapq import*
n,m,*t=map(int,open(0).read().split())
d=defaultdict(list)
for a,b in zip(t[::2],t[1::2]):d[a].append(b)
q=[]
for i in sorted(d.keys())[::-1]:
    for b in sorted(d[i])[::-1][:m-i+1]:
        if len(q)<=m-i:heappush(q,b)
        elif q and q[0]<b:heappushpop(q,b)
print(sum(q))
a,b,c=map(int,input().split)
if b>=c:
  print(a*c)
else:
  print(a*b)

### FIXED CODE ###

a,b,c=map(int,input().split())
if a*b>=c:
  print(c)
else:
  print(a*b)
x,y = input().split()
a = x-1
b = y-1
print(a*b)

### FIXED CODE ###

x,y = map(int, input().split())
print((x-1)*(y-1))
import numpy as np

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


class Node:
    def __init__(self, parent):
        self.parent = parent
        self.leaf = []
        self.score = 0

    def add_score(self, score):
        self.score += x
        for l in self.leaf:
            tree[l].add_score(x)


tree = {1: Node(None)}
tmp = np.array([list(map(int, input().split())) for _ in range(N-1)])
for i in np.argsort(tmp[:, 0]):
    p, c = tmp[i][0], tmp[i][1]
    if p not in tree:
        tree[p] = Node(None)
    tree[p].leaf.append(c)
    if c not in tree:
        tree[c] = Node(p)

for p, x in [tuple(map(int, input().split())) for _ in range(Q)]:
    tree[p].add_score(x)

print(' '.join([str(t.score) for t in tree.values()]))


### FIXED CODE ###

from collections import defaultdict

N, Q = map(int, input().split())
d = defaultdict(list)

for _ in range(N - 1):
    a, b = map(int, input().split())
    d[a].append(b)
    d[b].append(a)

c = defaultdict(int)

for _ in range(Q):
    p, x = map(int, input().split())
    c[p] += x

ans = [0 for i in range(N)]
que = [(1, 0, -1)]
while len(que) > 0:
    tmp = []
    for v, x, par in que:
        x += c[v]
        ans[v - 1] = str(x)
        for w in d[v]:
            if w != par:
                tmp.append((w, x, v))
    que = tmp

print(*ans)
from numpy import ndarray, argmin

input()
temp_on_sea, oracle = map(int, input().rstrip("\n").split())
heights = ndarray(list(map(lambda x: abs(int(x) - oracle) , input().rstrip("\n").split())))

print(heights.argmin() + 1)

### FIXED CODE ###

from numpy import array, argmin

input()
temp_on_sea, oracle = map(int, input().rstrip("\n").split())
heights = list(map(int , input().rstrip("\n").split()))
temp_diff = [abs(temp_on_sea - height * 0.006 - oracle) for height in heights]

print(array(temp_diff).argmin() + 1)
S = input()
if len(S) < 5:
  return False
else:
  if s[2] == s[3] and s[4] == s[5]:
    return True
  
return False
  

### FIXED CODE ###


s = input()

if len(s) < 5:
    print('No')

if s[2] == s[3] and s[4] == s[5]:
    print('Yes')
else:
    print('No')
N=input("")
N=int(N)
if 1<=N<=100:
  if N%2=0:
    N=N/2
    N=int(N)
    print(N)
  else:
    N=(N+1)/2
    N=int(N)
    print(N)
else:
  None

### FIXED CODE ###

N=input("")
N=int(N)
if 1<=N<=100:
  if N%2==0:
    N=N/2
    N=int(N)
    print(N)
  else:
    N=(N+1)/2
    N=int(N)
    print(N)
else:
  None
if x==0:
  return 1
elif x==1:
  return 0

### FIXED CODE ###

x=int(input())

if x==0:
  print(1)
elif x==1:
  print(0)
N = int(input())
S, T = input().split()
A = ''
for a in range(N):
  A.append(S[a]+T[a])
print(A)



### FIXED CODE ###

N = int(input())
S, T = input().split()
A = ''
for a in range(N):
  A += S[a]+T[a]
print(A)
a,b,k = map(int,input().split())
num = min(a,k)
a -= num
k -= num
print(a,max(b-k,0))

### FIXED CODE ###

a, b = input().split()

print(b+a)
str1, str2 = input().strip()

print("".join((str1,str2)))

### FIXED CODE ###

s = input()
ls = s.split()
print(ls[1] + ls[0])
N, P = map(int, input().split())
prime = prime_decomposition(P)
now = -1
count = 0
res = 1
for i in range(len(prime)):
    if now != prime[-i-1]:
        count = 0
        now = prime[-i-1]
    count += 1
    if count == N:
        res *= prime[-i-1]
print(int(res))

### FIXED CODE ###

N, P = map(int, input().split())
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table
prime = prime_decomposition(P)
now = -1
count = 0
res = 1
for i in range(len(prime)):
    if now != prime[-i-1]:
        count = 0
        now = prime[-i-1]
    count += 1
    if count == N:
        res *= prime[-i-1]
        count = 0
print(int(res))
N = int(input())
A = [int(i) for i in input().split()]
sort(A)
print(sum(A) - A[-1]/2)

### FIXED CODE ###

N = int(input())
A=[]
for i in range(N):
    A += [int(input())]

A.sort()
print(sum(A) - A[N-1]//2)
h, w = map(int, input().split())
mat = []
for i in range(h):
  a = list(map(int, input().split()))
  mat.append(a)
for i in range(h):
  b = list(map(int, input().split()))
  for j in range(w):
    mat[i][j] = abs(mat[i][j]-b[j])
m = max(map(max, mat))
dp = [[[False]*(m*(h+w)) for i in range(w)] for k in range(h)]
dp[0][0][mat[0][0]] = True
for y in range(h):
  for x in range(w):
      for k in range(m*(y+x)):
        if x > 0 and dp[y][x-1][k] or y > 0 and dp[y-1][x][k]:
          d = dp[y][x]
          d[k+mat[y][x]] = True
          d[abs(k-mat[y][x])] = True

for k in range(m*(h+w)):
  if dp[h-1][w-1][k]:
    print(k)
    exit()


### FIXED CODE ###

h, w = map(int, input().split())
mat = []
for i in range(h):
  a = list(map(int, input().split()))
  mat.append(a)
for i in range(h):
  b = list(map(int, input().split()))
  for j in range(w):
    mat[i][j] = abs(mat[i][j]-b[j])
m = max(map(max, mat))
dp = [[0b0 for i in range(w)] for k in range(h)]
dp[0][0] |= 0b1 << mat[0][0]
for y in range(h):
  for x in range(w):
        if x > 0:
          dp[y][x] |= dp[y][x-1] << mat[y][x]
          dp[y][x] |= dp[y][x-1] >> mat[y][x]
          anded = dp[y][x-1] & int('1'*(mat[y][x]+1), 2)
          reverse = format(anded, "0"+str(mat[y][x]+1)+"b")[::-1]

          dp[y][x] |= int(reverse, 2)
        if y > 0:
          dp[y][x] |= dp[y-1][x] << mat[y][x]
          dp[y][x] |= dp[y-1][x] >> mat[y][x]
          anded = dp[y-1][x] & int('1'*(mat[y][x]+1), 2)
          reverse = format(anded, "0"+str(mat[y][x]+1)+"b")[::-1]

          dp[y][x] |= int(reverse, 2)
        #print(bin(dp[y][x]))

keta = 0
while dp[h-1][w-1] % 2 == 0:
  keta += 1
  dp[h-1][w-1] //= 2
print(keta)
import sys
N=int(sys.stdin.readline())
H=list(map(int,sys.stdin.readline().split()))
dp[1]=abs(H[0]-H[1])
for i in range(2,N):
    dp[i]=min(dp[i-1]+abs(H[i-1]-H[i]),dp[i-2]+abs(H[i-2]-H[i]))
print(dp[-1])


### FIXED CODE ###

import sys
N=int(sys.stdin.readline())
H=list(map(int,sys.stdin.readline().split()))

dp=[0]*N

dp[1]=abs(H[0]-H[1])
for i in range(2,N):
    dp[i]=min(dp[i-1]+abs(H[i-1]-H[i]),dp[i-2]+abs(H[i-2]-H[i]))
print(dp[-1])
word = input()

string = input().lower()
last = ""

while last != "END_OF_TEXT":
	last = input().lower()
	string += last
	
print(string.count(word))

### FIXED CODE ###

word = input()

string = input().lower()
last = ""

while last != "END_OF_TEXT":
	last = input()
	string += " " + last.lower()

list_words = list(string.split())

count = 0

for s in list_words:
	if s == word:
		count += 1

print(count)
# -*- coding: utf-8 -*-

primes = [2]
n = 3
while n < 10000:
    flag = True
    for p in primes:
        if n % p == 0:
            flag = False
            break
    if flag:
        primes.append(n)
    n += 1

while True:
    n = int(raw_input())
    if n == 0:
        break
    sum = 0
    for i in range(n):
        sum += primes[i]
    print sum

### FIXED CODE ###

# -*- coding: utf-8 -*-

primes = [2]
i = 3
count = 1
while count < 10000:
    flag = True
    for p in primes:
        if i % p == 0:
            flag = False
            break
    if flag:
        primes.append(i)
        count += 1
    i += 1

while True:
    n = int(raw_input())
    if n == 0:
        break
    sum = 0
    for i in range(n):
        sum += primes[i]
    print sum
# from math import inf
inf = 10**50

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

d = [0] + ([-inf]*(N-1))
pred = [None] * N

for i in range(N-1):
    for j in range(M):
        u = edges[j][0]-1
        v = edges[j][1]-1
        w = edges[j][2]
        if (d[v] < d[u] + w) and (d[u] != -inf):
            d[v] = d[u] + w
            pred[v] = u

positive_loop = False
for i in range(N):
    for j in range(M):
        u = edges[j][0]-1
        v = edges[j][1]-1
        w = edges[j][2]
        if (v == N-1) and (d[u] + w > d[v]) and (d[u] != -inf):
            positive_loop = True
            break
    if positive_loop:
        break

if positive_loop:
    print("inf")
else:
    print(d[N-1])


### FIXED CODE ###

from math import factorial as f

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

v.sort()


sum_v = 0
for i in range(N-A+1, N):
    sum_v += v[i]

i_max = N+1
count_max = 1
sum_max = 0

max_nums = []
if A == 1:
    current_num = -1
    current_count = 0
else:
    current_num = v[N-A+1]
    current_count = v[N-A+1:].count(v[N-A+1])
for i in range(N-A, N-B-1, -1):
    if v[i] == current_num:
        current_count += 1
    else:
        current_num = v[i]
        current_count = 1
    count = N-i
    sum_v += v[i]
    if sum_v * count_max > sum_max * count:
        count_max = count
        sum_max = sum_v
        max_nums = [(v[i], current_count)]
    elif sum_v * count_max == sum_max * count:
        if v[i] not in max_nums:
            max_nums.append((v[i], current_count))

def count(vi):
    return v.count(vi)

def c(n, k):
    return f(n)//(f(k)*f(n-k))

ans = 0
for vi, cc in max_nums:
    ans = ans + c(count(vi), cc)
    # print(vi, count(vi), cc)

print(sum_max/count_max)
print(ans)
N = int(input())
A = list(map(int,input().split()))

for i in range(N+1):
    A[i] = 1 / A[i]

print(1 / sum(A))

### FIXED CODE ###

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

for i in range(N):
    A[i] = 1 / A[i]

print(1 / sum(A))
x=input('')
k=input('')
if k*500>=x:
    print ("Yes")
else:
    print ("No")

### FIXED CODE ###

k,x=map(int,input().split())
if k*500>=x:
    print("Yes")
else:
    print("No")
#16D8101014F 久留米 竜之介 Python3
#a=[]
while(True):
	i=0
	tmp=0
	a=input().split('"') 
	aL=a.len()
	b=input().split('"')
	bL=b.len()
	if aL != bL:
		print("DIFFELENT")
	else:
		while(True):
			if a[i] != b[i]:
				print("DIFFERENT")
				break
			elif i > aL-2:
				if tmp==1:
					print("CLOSE")
					break
				else:
					print("IDENTICAL")
					break
			elif a[i+1] != b[i+1]:
				if tmp==1:
					print("DIFFERENT")
					break
				else: tmp=1
			i +=2
	


### FIXED CODE ###

#16D8101014F 久留米 竜之介 Python3
#a=[]
while(True):
	i=0
	tmp=0
	a=input().split('"') 
	aL=len(a)
	if a[0] ==".":
		break
	b=input().split('"')
	bL=len(b)
		
	if aL != bL:
		print("DIFFERENT")
	else:
		while(True):
			if a[i] != b[i]:
				print("DIFFERENT")
				break
			elif i > aL-2:
				if tmp==1:
					print("CLOSE")
					break
				else:
					print("IDENTICAL")
					break
			elif a[i+1] != b[i+1]:
				if tmp==1:
					print("DIFFERENT")
					break
				else: tmp=1
			i +=2
a = input()
b = input()
c = input()

print (a)
print (b)
print (c)

### FIXED CODE ###

input = input()
a,b,c = map(int,input.split())
print (min(b//a,c))
n = int(input())
print n//2

### FIXED CODE ###

n = int(input())
print((n-1)//2)
A,B=input().split()

for x in (A,B):
  if float(x)==int(float(x)):
    x = int(x)
  else:
    x = float(x)

def dicimal2int(d):
  d = str(d)
  if '.' not in d:
    return int(d),0
  if d[:2]=="0.":
    for i in range(2,len(d)):
      if d[i] != '0':
        break
    n_move = len(d)-2
    return int(d[i:]),n_move
  idx = d.index('.')
  n_move = len(d)-idx-1
  return int(d[:idx]+d[idx+1:]),n_move

C1,n1 = dicimal2int(A)
C2,n2 = dicimal2int(B)

D = C1*C2
n = n1+n2

if n==0:
  print(D)
  exit()
  
def int2dicimal(N,n_move):
  if n_move==0:
    return N
  N = str(N)
  for i in range(len(N)):
    if N[-i-1] != '0':
      break
  n_zero = i
  if n_zero>n_move:
    return int(N[:-n_move])
  if n_zero>0:
    N = N[:-n_zero]
    n_move -= n_zero
  if len(N)-1>=n_move:
    return float(N[:-n_move]+'.'+N[-n_move:])
  return float("0."+'0'*(n_move-len(N))+N)

print(int(int2dicimal(D,n)))

### FIXED CODE ###

A,B=input().split()
A = int(A)
B = int(float(B)*100+.5)
print(A*B//100)
from collections import Counter

n = int(input())
a = map(int, input().split())
h = Counter()
for x in a:
    h[x] += 1
f = True
for k, v in h.most_common():
    if n % 2 == 1 and k == 0:
        if v != 1:
            f = False
            break
    elif v != 2:
        f = False
        break
MOD = 1_000_000_007
def mpow(n, p, mod):
    r = 1
    while p > 0:
        if p & 1 == 1:
            r = r * n % mod
        n = n * n % mod
        p >>= 1
    return r
print(mpow(2, int(n / 2), MOD) if f else 0) 

### FIXED CODE ###

from collections import Counter

n = int(input())
a = list(map(int, input().split()))
h = Counter()
for x in a:
    h[x] += 1
f = True
for k, v in h.items():
    if n % 2 == 1 and k == 0:
        if v != 1:
            f = False
            break
    elif v != 2:
        f = False
        break
MOD = 1000000007
def mpow(n, p, mod):
    r = 1
    while p > 0:
        if p & 1 == 1:
            r = r * n % mod
        n = n * n % mod
        p >>= 1
    return r
print(mpow(2, int(n / 2), MOD) if f else 0)
a = int(input())
b = int(input())
if a<10 and b<10:
  print(a*b)

  
else:
  print('-1')


### FIXED CODE ###

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

if a<10 and b<10:
  print(a*b)
  
else:
  print('-1')
P=[]
C=[]
point=1000

D,G=map(int,input().split())
for i in range(D):
    p,c= map(int,input().split())
    P.append(p)
    C.append(c)

#とりあえず全部解くor解かないで目標スコアを超えるか超えないかを考える

for i in range(2**D) :
    score=0
    solve=0
    needproblem=0
    for j in range(D) :                  
        if (i>>j) & 1 :
            score+=P[j]*100*(j+1)+C[j]
            solve+=P[j]
        if (~i>>j) & 1 : 
            needproblem=j+1
    if score>G :
        point=min(point,solve)

#ぎりぎりスコアが届いていない場合、1問も解かなかった問題の中で最も一題あたりの点が高い問題だけ解いてみる
#中途半端に大問を解ききるのが１種類以下でも目標に届く場合もあるという予想

    elif score<=G :                
        needsolve=(G-score)//(needproblem*100)
        if needsolve>P[needproblem-1] :   
        elif needsolve<=P[needproblem-1] :
            resolve=solve+needsolve
            point=min(point,resolve)

print(point)

### FIXED CODE ###

D,G=map(int,input().split())
# bit全探索で、全問解く問題の組み合わせをすべて試す
 
scores=[None]*D
for i in range(D):
  p,c=map(int,input().split())
  # 一問の得点、問題数、ボーナス、全てといたときの得点
  scores[i]=[(i+1)*100,p,c,((i+1)*100)*p+c]
 
# あとあとのために点数高い順に並べる
scores=sorted(scores,key=lambda x:x[0])[::-1]
 
# 全問とく組み合わせに対して、最小の問題数
ans=D*100
for i in range(2**D):
  total=0
  solve=0
  for j in range(D):
    if (i>>j)&1:
      # 全問とく問題のボーナスを足していく
      total+=scores[j][3]
      solve+=scores[j][1]
  if total>=G:
    if ans>solve:
      ans=solve
    continue
  rest=G-total
  for j in range(D):
    if (i>>j)&1==0:
      point=scores[j][0]
      num=scores[j][1]-1 # 全問とかないので1減らす
      if point*num<rest:
        rest-=point*num
        solve+=num
      else:
        solve+=(rest//point+(rest%point>0))
        rest=0
    if rest<=0 and ans>solve:
      ans=solve
  
print(ans)
N,P =map(int,input().split(' '))
if N==1:
    print(P)
    exit()
for i in range(int(pow(P,1/N)//1)+1,0,-1):
    if P%pow(i,N)==0:
        print(i)
        break

### FIXED CODE ###

from collections import Counter
N,P =map(int,input().split(' '))
if N==1:
    print(P)
    exit()
prime = []
f = 2
while f**2 <=P:
    if P%f==0:
        prime.append(f)
        P//=f
    else:
        f += 1
if P != 1:
    prime.append(f)

ans = 1
for k,v in Counter(prime).items():
    if v//N:
        ans *= k**(v//N)
print(ans)
A = int(input())
B = int(input())

if 1 <= A <= 20 and 1 <= B <= 20 :
    print(A * B)

else :
    print(-1)

### FIXED CODE ###

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

if 1 <= A <= 9 and 1 <= B <= 9 :
    print(A * B)

else :
    print(-1)
A, B, C, D, E, F=map(int, input().split())
for i in range(31):
    w=100*A*i
    s=0
    if s+w>F:
        break
    for j in range(31):
        w=100*A*i+100*B*j
        s=0
        if s+w>F:
            break
        for k in range(3001):
            w=100*A*i+100*B*j
            s=C*k
            if s+w>F:
                break
            for l in range(3001):
                w=100*A*i+100*B*j
                s=C*k+D*l
                if s+w>F:
                    break
                if w!=0 and s*(100+E)<=(s+w)*E and sans*(s+w)<=s*(sans+wans) and w+s<=F:
                    sans=s
                    wans=w
                #print(sans,sans+wans)
print(sans+wans,sans)

### FIXED CODE ###

A, B, C, D, E, F=map(int, input().split())
wans=0
sans=0
for i in range(31):
    w=100*A*i
    s=0
    if s+w>F:
        break
    for j in range(31):
        w=100*A*i+100*B*j
        s=0
        if s+w>F:
            break
        for k in range(3001):
            w=100*A*i+100*B*j
            s=C*k
            if s+w>F:
                break
            for l in range(3001):
                w=100*A*i+100*B*j
                s=C*k+D*l
                if s+w>F:
                    break
                if w!=0 and s*(100+E)<=(s+w)*E and sans*(s+w)<=s*(sans+wans) and w+s<=F:
                    sans=s
                    wans=w
                #print(sans,sans+wans)
print(sans+wans,sans)
h, w = map(int, input().split())
s = [input() for _ in range(w)]
for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            flag = 0
            L = []
            if i == 0 and j == 0:
                L.extend([(0, 1), (1, 0)])
            elif i == 0 and j == w - 1:
                L.extend([(-1, 0), (1, 0)])
            elif i == h - 1 and j == 0:
                L.extend([(1, 0), (0, 1)])
            elif i == h - 1 and j == w - 1:
                L.extend([(-1, 0), (0, -1)])
            elif i == 0:
                L.extend([(1, 0), (0, -1), (0, 1)])
            elif i == h - 1:
                L.extend([(-1, 0), (0, 1), (0, -1)])
            elif j == 0:
                L.extend([(-1, 0), (1, 0), (0, 1)])
            elif j == w - 1:
                L.extend([(-1, 0), (1, 0), (0, -1)])
            else:
                L.extend([(-1, 0), (1, 0), (0, -1), (0, 1)])
            
            for dx, dy in L:
                    if s[i + dx][j + dy] == '#':
                        flag = 1
            if flag == 0:
                print('No')
                exit()
else:
    print('Yes')



### FIXED CODE ###

h, w = map(int, input().split())
s = [input() for _ in range(h)]
dx = [-1, 0, 0, 1]
dy = [0, -1, 1, 0]
for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            flag = 0
            for k in range(4):
                ny = i + dy[k]
                nx = j + dx[k]
                if nx < 0 or w <= nx:
                    continue
                if ny < 0 or h <= ny:
                    continue
                if s[ny][nx] == '#':
                    flag = 1
            if flag == 0:
                print('No')
                exit()
else:
    print('Yes')
import sys
import math


N_MAX = 200000 + 5
INF = 10**9 + 7
sys.setrecursionlimit(N_MAX)
MOD = 10**9 + 7


def eatosthenes(N):
    prime = []
    D = [1] * (N + 1)

    for i in range(2, N + 1):
        if D[i] != 1:
            continue
        for j in range(N // i + 1):
            if D[i * j] == 1:
                D[i * j] = i
        prime.append(i)

def main():
    N = int(sys.stdin.readline().rstrip())
    A = [int(x) for x in sys.stdin.readline().rstrip().split()]

    maxA = max(A)
    primelist = eatosthenes(maxA)

    # 1 <= a <= maxA までの、要素の登場回数
    C = [0] * (maxA + 1)
    for a in A:
        C[a] += 1

    pc = True

    # p の倍数である個数をカウントする
    for p in primelist:
        cnt = 0
        for k in range(maxA // p + 1):
            cnt += C[k * p]

        # k*p となるような要素が2個以上あったら、pairwise coprime ではない
        if cnt > 1:
            pc = False

    if pc:
        print("pairwise coprime")
        return

    GCD = A[0]
    for i in range(1, N):
        GCD = math.gcd(GCD, A[i])

    if GCD == 1:
        print("setwise coprime")
        return

    print("not coprime")


main()


### FIXED CODE ###

import sys
import math


N_MAX = 200000 + 5
INF = 10**9 + 7
sys.setrecursionlimit(N_MAX)
MOD = 10**9 + 7


def main():
    N = int(sys.stdin.readline().rstrip())
    A = [int(x) for x in sys.stdin.readline().rstrip().split()]

    maxA = max(A)

    # 1 <= a <= maxA までの、要素の登場回数
    C = [0] * (maxA + 1)
    for a in A:
        C[a] += 1

    pc = True

    # p の倍数である個数をカウントする
    for p in range(2, maxA + 1):
        cnt = 0
        for k in range(maxA // p + 1):
            cnt += C[k * p]

        # k*p となるような要素が2個以上あったら、pairwise coprime ではない
        if cnt > 1:
            pc = False

    if pc:
        print("pairwise coprime")
        return

    GCD = A[0]
    for i in range(1, N):
        GCD = math.gcd(GCD, A[i])

    if GCD == 1:
        print("setwise coprime")
        return

    print("not coprime")


main()
A,B,C=map(int,input().split())
if A[-1]==B[0] and B[-1]==C[0]:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

A,B,C=map(str,input().split())
if A[-1]==B[0] and B[-1]==C[0]:
  print('YES')
else:
  print('NO')
ID_num, gate_num = tuple([int(i) for i in input().split(" ")])
min_list = []
max_list = []
for i in range(gate_num):
  	min_ID, max_ID = tuple([int(i) for i in input().split(" ")])
    min_list.append(min_ID)
    max_list.append(max_ID)
print(min(max_list) - max(min_list))

### FIXED CODE ###

ID_num, gate_num = tuple([int(i) for i in input().split(" ")])
min_list = []
max_list = []
for i in range(gate_num):
    min_ID, max_ID = tuple([int(i) for i in input().split(" ")])
    min_list.append(min_ID)
    max_list.append(max_ID)
M = min(max_list)
m = max(min_list)
if M >= m:
    print(min(max_list) - max(min_list) + 1)
else:
    print(0)
import math
A, B, H, M = = map(int, open(0).read().split())

K = abs(math.pi*M/30 - math.pi*H/6)

print(math.sqrt(A**2+B**2 - 2*A*B*math.cos(K)))


### FIXED CODE ###

import math
A, B, H, M = map(int, input().split())


arg_b = math.pi * float(M) / 30
arg_a = (math.pi / 6) * (float(H) + float(M)/60) 
K = abs(arg_b - arg_a)
C = math.sqrt(A*A+B*B - 2*A*B*math.cos(K))
print(C)