Harryxun/stf_run huggingface dataset:
num = int(input())
str_list = input.split(" ")

yes = True
 
for index, s in enumerate(str_list):
	if s in str_list[:index]:
    	yes = False
		break
if yes:
	print("YES")
else:
	print("NO")

### FIXED CODE ###

num = input()
str_list = input().split(" ")
 
yes = True
num_dict = {}
for s in str_list:
	if s in num_dict:
		yes = False
		break
	else:
		num_dict[s] = 1
if yes:
	print("YES")
else:
	print("NO")
M,N,X=map(int,input().split())
C=[list(map(int,input().split())) for i in range(N)]
INF=float("inf")
ans=INF

for i in range(1,2**N):
    skills=[0]*M
    total_cost=0
    for j in range(N):
        if ((i>>j)&1):
            total_cost+=C[j][0]
            for k in range(M):
                skills[k]+=C[j][k+1]
    if min(skills)>=X:
        ans=min(ans,total_cost)
        
print(ans if ans != INF else -1)

### FIXED CODE ###

N,M,X=map(int,input().split())
C=[list(map(int,input().split())) for i in range(N)]
INF=float("inf")
ans=INF

for i in range(1,2**N):
    skills=[0]*M
    total_cost=0
    for j in range(N):
        if ((i>>j)&1):
            total_cost+=C[j][0]
            for k in range(M):
                skills[k]+=C[j][k+1]
    if min(skills)>=X:
        ans=min(ans,total_cost)
        
print(ans if ans != INF else -1)
d, g = map(int, input().split())
    pc = [list(map(int, input().split())) for _ in range(d)]
     
    ans = 1000
    for i in range(1 << d):
    	score = 0
    	num = 0
    	rest = 0
    	for j in range(d):
    		if ((i >> j) & 1) == 1:
    			score += pc[j][0]*100*(j+1) + pc[j][1]
    			num += pc[j][0]
    		else:
    			rest = j
    	if score < g:
    		need = (g-score-1)//(100*(rest+1)) + 1
    		if need > pc[rest][0]-1:
    			continue
    		else:
    			num += need
    	ans = min(ans, num)
     
    print(ans)

### FIXED CODE ###

d, g = (int(i) for i in input().split())
p = [[int(i) for i in input().split()] for i in range(d)]
ans = 1000

for i in range(1 << d): # 4
    score = 0
    num = 0
    rest = 0
    for j in range(d): # 2
        if ((i >> j) & 1) == 1: # 0 1  2=10
            score += p[j][0] * 100 * (j + 1) + p[j][1]
            num += p[j][0]
        else:
            rest = j
    if score < g:
        need = (g - score - 1) // (100*(rest+1)) + 1
        if need > p[rest][0] - 1: # 0だったところの中で一番大きいところの問題数-1よりも必要手数が多かったら初めに戻る
            continue
        else:
            num += need
    ans = min(ans, num)
print(ans)
k=int(input())
ans=2
s_1=7%k
m=0
j=0
if k%2==0 or k%5==0:
  print(-1)
elif k==1 or k==7:
  print(1)
elif k%7==0:
  l=9*k/7
  i=0
  while j==0:
    m=(m+s_1*(((s_2**i)%l-1)%l))%l
    if m==0:
      j==1
    else:
      i+=1
      ans+=1
  print(ans)
else:
  l=9*k
  s=10%k
  while j==0:
    m=(m+s_1*s)
    if m==0:
      j==1
    else:
      i+=1
      ans+=1
      s=(10*s)%k
  print(ans)


### FIXED CODE ###

k=int(input())
m=0
for i in range(k):
  m=(m*10+7)%k
  if m==0:
    break
  elif i==k-1:
    print(-1)
    exit()
print(i + 1)
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
cnt = 0
cnt2 = 0
for i, ai in enumerate(a):
    for j in range(i, n):
        if ai > a[j]:
            cnt += 1
    if i > 0:
        for j in range(i):
            if ai > a[j]:
                cnt2 += 1

if k % 2 == 0:
    mul = (1 + k) * (k // 2)
else:
    mul = (1 + k) * (k // 2) + (k // 2 + 1)
if k > 1:
    k -= 1
    if k % 2 == 0:
        mul2 = (1 + k) * (k // 2)
    else:
        mul2 = (1 + k) * (k // 2) + (k // 2 + 1)
print(((cnt * mul) + (cnt2 * mul2)) % 1000000007)


### FIXED CODE ###

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
cnt = 0
cnt2 = 0
for i, ai in enumerate(a):
    for j in range(i, n):
        if ai > a[j]:
            cnt += 1
    if i > 0:
        for j in range(i):
            if ai > a[j]:
                cnt2 += 1

if k % 2 == 0:
    mul = (1 + k) * (k // 2)
else:
    mul = (1 + k) * (k // 2) + (k // 2 + 1)
mul2 = 0
if k > 1:
    k -= 1
    if k % 2 == 0:
        mul2 = (1 + k) * (k // 2)
    else:
        mul2 = (1 + k) * (k // 2) + (k // 2 + 1)
print(((cnt * mul) + (cnt2 * mul2)) % 1000000007)
n,a,b = map(int, input().split())

ans=0
for i in range(n)
  num=str(i+1)
  sm=0
  for j in num:
    sm+=j
  if a<=sm<=b:
    ans+=1
print(ans)
    
  

### FIXED CODE ###

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

ans=0
for i in range(n):
  num=str(i+1)
  sm=0
  for j in num:
    sm+=int(j)
  if a<=sm<=b:
    ans+=(i+1)
print(ans)
import math
from functools import reduce

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

def gcd_list(num_list):
    return reduce(math.gcd, num_list)

GCD = 0
for i in range(N):
    others = A[:i] + A[i+1:]
    gcd = gcd_list(others)
    if gcd > GCD:
        GCD = gcd
print(GCD)

### FIXED CODE ###

from fractions import gcd

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

GCD1 = []
g = A[0]
for a in A:
    g = gcd(g, a)
    GCD1.append(g)

B = A[::-1]
g = B[0]
GCD2 = []
for b in B:
    g = gcd(g, b)
    GCD2.append(g)

ans = 1
for i in range(N):
    if i == 0:
        a = GCD2[N-2]
    elif i == N-1:
        a = GCD1[N-2]
    else:
        a = gcd(GCD1[i-1], GCD2[N-i-2])
    ans = max(ans, a)
print(ans)
#bin()やformat(数字 ,"b")を使うとstr型になる
#bin()とformat(数字 ,"#b")は同意

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

for i in range(N): A[i] = format(A[i], "059b") #ここで全て60ビットの二進数に変換

mod = 10**9+7

sum = 0
for i in range(1,61):
    count0 = 0
    count1 = 0
    for j in range(N):
        if A[j][-i] == "0": #str型であることに注意！
            count0 += 1
        else:
            count1 += 1 
    sum += (count0 * count1) << (i-1) #左シフトだが，2**(i-1)でもOK
print(sum%mod)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
mod = 10**9+7
xorsum = 0
for i in range(60):
  c1 = sum([1 for a in A if (a >> i) & 1]) #
  xorsum += (c1*(N-c1)*(1<<i))
  xorsum = xorsum%mod
print(xorsum%mod)
n,m,k = map(int, input().split())
ans = "No"
if k%(m-1)==0 and k//(m-1) > 1:
  if k//(m-1) <= n: ans = "Yes"
if k%(n-1)== 0 and k//(n-1) > 1:
  if k//(n-1) <= m: ans = "Yes"
print(ans)

### FIXED CODE ###

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

for i in range(n+1):
  for j in range(m+1):
    if i*(m-j)+j*(n-i)==k:
      print("Yes")
      exit()
print("No")
n=int(input())
a=list(map(int,input().split()))

answer=[0]*n
for i in range(n):
    answer[a[i]-1]+=1

for i in range(n):
    print(answer[i])



### FIXED CODE ###

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

answer=[0]*n
for i in range(n-1):
    answer[a[i]-1]+=1

for i in range(n):
    print(answer[i])
n = int(input())
n = int(input())
mod = int(1e9)+7
print((pow(10, n, mod) - 2*pow(9, n, mod) + pow(8, n, mod))%mod)

### FIXED CODE ###

n = int(input())
mod = int(1e9)+7
print((pow(10, n, mod) - 2*pow(9, n, mod) + pow(8, n, mod))%mod)
n = input()
a = input()
n %= 500
if n <= a:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n = int(input())
a = int(input())
n %= 500
if n <= a:
    print('Yes')
else:
    print('No')
N = int(input())
H = list(map(int, input().split()))

ans = 0
if N > 1:
  for i in range(1, N):
    if (H[i] >= H[i - 1]:
      ans += 1

print(ans + 1)

### FIXED CODE ###

import itertools
S = input()

p1 = itertools.cycle('01')
p2 = itertools.cycle('10')

ans1=0
ans2=0
for s,P1,P2 in zip(S,p1,p2):
  if s == P1:
    ans1 += 1
  if s == P2:
    ans2 += 1
print(min(ans1,ans2))
# F
import numpy as np
from collections import deque
 
TT_list = []
# input
N, L = map(int, input().split())
T = 0.0
vt_now = 0.0
v_now = 0
que = deque()

for i in range(N):
    ti, v = map(int, input().split())
    t = float(ti)
    v_now += v
    vt_now += v*t
    # add
    if v == L:
        que.append([t, v])
    else:
        while v < L and len(que) > 0:
            t_, v_ = que.pop()
            if t_ <= t:
                que.append([t_, v_])
                que.append([t, v])
                break
            elif v + v_ >= L:
                v_ = v + v_ - L
                t = ((L - v) * t_ + v * t) / L
                v = L
                que = deque([t, v])
                v_now = L
                vt_now = v*L
                # break
            else:
                t = (t*v + t_*v_) / (v + v_)
                v = v + v_
    # minus
    while v_now > L:
        if que[0][1] <= v_now - L:
            v_now -= que[0][1]
            vt_now -= que[0][1]*que[0][0]
            que.popleft()
        else:
            que[0][1] -= v_now - L
            vt_now -= (v_now - L)*que[0][0]
            v_now = L
            
    TT_list.append(vt_now / L)

for i in range(N):
    print(TT_list[i])


### FIXED CODE ###

# F
from collections import deque
 
TT_list = []
# input
N, L = map(int, input().split())
T = 0.0
vt_now = 0.0
v_now = 0
que = deque()

for i in range(N):
    ti, v = map(int, input().split())
    t = float(ti)
    v_now += v
    vt_now += v*t
    # add
    if v == L:
        que.append([t, v])
    else:
        while v < L and len(que) > 0:
            t_, v_ = que[-1]
            if t_ <= t:
                que.append([t, v])
                break
            elif v + v_ >= L:
                v_ = v + v_ - L
                t = ((L - v) * t_ + v * t) / L
                v = L
                que = deque([[t, v]])
                v_now = L
                vt_now = t*L
                # break
            else:
                t = (t*v + t_*v_) / (v + v_)
                v = v + v_
                que.pop()
    # minus
    while v_now > L:
        if que[0][1] <= v_now - L:
            v_now -= que[0][1]
            vt_now -= que[0][1]*que[0][0]
            que.popleft()
        else:
            que[0][1] -= v_now - L
            vt_now -= (v_now - L)*que[0][0]
            v_now = L
            
    TT_list.append(vt_now / L)

for i in range(N):
    print(TT_list[i])
a,b,c,d,e,k = map(int, input().split())

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

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if (e-a>k):
  print(":(")
else:
  print("Yay!")
#coding: utf-8

inputN, inputK = map(int, input().split())
inputA = list(map(int, input().split()))
minNumber = inputN
minPos = 0

if inputN == inputK:
    print (1)
elif inputN <= (inputK-1)*100000 + 1:
    for i in range(2, 100001):
        if inputN <= (inputK-1)*i + 1:
            print (i)
            break
else:

    for i in range(len(inputA)):
        if inputA[i] < minNumber:
            minNumber = inputA[i]
            minPos = i

    splitNumber = (inputN + 1) / (inputK - 1)
    print (int(splitNumber))


### FIXED CODE ###

#coding: utf-8

counter = 0
inputStr = input()

strA = "+"
strB = "-"

for i in range(1, 5):
    if inputStr[i-1:i] == strA:
        counter += 1
    else:
        counter -= 1

print (counter)
import numpy as np

n=int(input())
xy=[]
for i in range(n):
    xy.append(list(map(int,input().split())))

def naiseki(a,b):
    if (a[0]*b[0]+a[1]*b[1])>0.0:
        return True
    else:
        return False
    
ans=0

for i in range(10001):
    xl=np.cos(np.pi*2.0*i/10000.0)
    yl=np.sin(np.pi*2.0*i/10000.0)
    x=0
    y=0
    for j in range(n):
        if naiseki([xl,yl],xy[j]):
            x+=xy[j][0]
            y+=xy[j][1]
    ans=max(ans,np.sqrt(x**2+y**2))
print(ans)


### FIXED CODE ###

import numpy as np

n=int(input())
xy=[]
for i in range(n):
    xy.append(list(map(int,input().split())))

def naiseki(a,b):
    if (a[0]*b[0]+a[1]*b[1])>0.0:
        return True
    else:
        return False
    
ans=0

for i in range(1001):
    xl=np.cos(np.pi*2.0*i/1000.0)
    yl=np.sin(np.pi*2.0*i/1000.0)
    x=0
    y=0
    for j in range(n):
        if naiseki([xl,yl],xy[j]):
            x+=xy[j][0]
            y+=xy[j][1]
    ans=max(ans,np.sqrt(x**2+y**2))
print(ans)
import java.util.*;
public class Main{
  public static void main(String[] args){
    	Scanner s = new Scanner(System.in);
    	String word = s.nextLine();
    	int leng = word.length();
    	String re = word.reverse();
    	int c = 0;
    	for(i=leng-1; i<=0; i--){
          if(word.charAt(i) == re.charAt(i)){
            	continue;
          }else
            c++;
        }
    System.out.println(c/2);
  }
}

### FIXED CODE ###

n = input()
count = 0
first, second = n[:len(n)//2], n[(len(n)+1)//2:]
if first == reversed(second):
    print(count)
else:
    for x in range(len(first)):
        if first[x] != second[len(second)-x-1]:
            count += 1
    print(count)
a,b = map(int,input())

if (a+b) == 15:
  print("+")
elif (a*b)==15:
  print("*")
else:
  print("x")

### FIXED CODE ###

a,b = map(int,input().split())
if (a+b) == 15:
  print("+")
elif (a*b) == 15:
  print("*")
else:
  print("x")
N = int(input())
S = list(input())
cnt = 0
if S.count('#')>S.count('.'):
  word = '#'
else:
  word = '.'
ans=""
for i in range(N):
  if i==0:
    ans+=S[i]
    pass
  if ans[-1]=='#' and S[i]=='.':
    cnt+=1
    ans+=word
  else:
    ans+=S[i]
  print(ans)
print(cnt)

### FIXED CODE ###

N = int(input())
S = list(input())
b = S.count("#")
w = S.count(".")
ans = min(b,w)
if b>=1 and w>=1:
  cost = N-w
  for i in range(N-1, -1, -1):
    if S[i]=='.':
      cost+=1
    else: 
      cost-=1
      ans = min(ans,cost)
print(ans)
import numpy as np
N,M,X=map(int,input().split())
allList=[]
for _ in range(N):
    allList.append(np.array(list(map(int,input().split()))))
minnum=10**7
for i in range(2**N):
    skill=[0]*(M+1)
    flag=True
    for row in range(N):
        if i&(2**row)>0:
            skill+=allList[row]
    for i in range(M):
        if skill[j+1]<X:
            flag=False
    if flag:
        minnum=min(minnum,skill[0])
if minnum==10**7:
    minnum=-1
print(minnum)

### FIXED CODE ###

import numpy as np
N,M,X=map(int,input().split())
allList=[]
for _ in range(N):
    allList.append(np.array(list(map(int,input().split()))))
minnum=10**7
for i in range(2**N):
    skill=[0]*(M+1)
    flag=True
    for row in range(N):
        if i&(2**row)>0:
            skill+=allList[row]
    for j in range(M):
        if skill[j+1]<X:
            flag=False
    if flag:
        minnum=min(minnum,skill[0])
if minnum==10**7:
    minnum=-1
print(minnum)
a=input()
if a==SUN:
  print(7)
elif a==MON:
  print(6)
elif a==TUE:
  print(5)
elif a==WED:
  print(4)
elif a==THU:
  print(3)
elif a==FRI:
  print(2)
elif a==SAT:
  print(1)

### FIXED CODE ###

a=input()
if a=="SUN":
  print(7)
elif a=="MON":
  print(6)
elif a=="TUE":
  print(5)
elif a=="WED":
  print(4)
elif a=="THU":
  print(3)
elif a=="FRI":
  print(2)
elif a=="SAT":
  print(1)
def BFS(G):
    ans = [0] + [[i+1,-1] for i in range(len(G))]
    def main(G,i,d):
        ans[i] = [i, d]
        for j in G[i-1][2:]: main(G,j,d+1)
    main(G,1,0)
    return ans[1:]


if __name__=='__main__':
    n = int(input())
    G = [list(map(int,input().split())) for _ in range(n)]
    for out in BFS(G): print(*out)

### FIXED CODE ###

def BFS(G):
    ans = [0] + [[i+1,-1] for i in range(len(G))]
    def main(G,i,d):
        if -1 < ans[i][1] <= d: return
        ans[i] = [i, d]
        for j in G[i-1][2:]: main(G,j,d+1)
    main(G,1,0)
    return ans[1:]


if __name__=='__main__':
    n = int(input())
    G = [list(map(int,input().split())) for _ in range(n)]
    for out in BFS(G): print(*out)
N=int(input())
X=[]
for i in range(N):
    X.append(list(map(int,input().split())))

total_d=0
for i in range(N):
    for j in range(i):
        total_d+=((X[i][0]-X[j][0])**2+(X[i][1]-X[j][1])**2)**0.5
ans=total_d*2/N
print(ans)

### FIXED CODE ###

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

total_d=0
for i in range(N):
    for j in range(i):
        total_d+=((X[i][0]-X[j][0])**2+(X[i][1]-X[j][1])**2)**0.5
ans=total_d*2/N
print(ans)
n,k= map(int,input().split())
s = map(int,input().split())
s.sort()
print(sum(s[:k]))

### FIXED CODE ###

n,k= map(int,input().split())
s = map(int,input().split())
li = list(s)
li.sort()
print(sum(li[:k]))
N = int(input())
print(1000*math.ceil(N/1000)-N)

### FIXED CODE ###

import math
N = int(input())
print(1000*math.ceil(N/1000)-N)
def LCS():
  x = raw_input()
  y = raw_input()
  X = len(x)
  Y = len(y)
  
  for i in range(X):
    c[i][0] = 0
  for j in range(Y):
    c[0][j] = 0

  for i in range(X):
    for j in range(Y):
      if X[i] == Y[i]: 
        c[i][j] = c[i - 1][j - 1] + 1

      elif:
        c[i][j] = max(c[i - 1][j], c[i][j - 1])
        

  print c[X][Y]

q = input()

for i in range(q):
  LCS

  
    

### FIXED CODE ###

def LCS():
    X = raw_input()
    Y = raw_input()
 
    a, b = len(X), len(Y)
    c1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = X[i]
        c2 = c1+[]
        for j in range(b):
            if e1 == Y[j]:
                c1[j+1] = c2[j] + 1
            elif c1[j+1] < c1[j]:
                c1[j+1] = c1[j]
    return c1[-1]
 
n = input()
for i in range(n):
    print LCS()
a,b,k = map(int, input().split())
if a==0 and b==0:
    print(0)
else:
    a = a - k
    a2 = a
    if a<0:
        a=0
    b= b + a2
    if b<0:
        b=0
print(a,b)


1 3 1000
0 1

### FIXED CODE ###

def solve(a,b,k):
    if a==0 and b==0:
        return '0 0'
    if a>=k:
        str = '%d %d' % (a-k,b)
        return str
    else:
        b = b + a - k
        a = 0
        if b<0:
            return '0 0'
        str = '0 %d' % (b)
        return str 
        

a,b,k = map(int, input().split())
print(solve(a,b,k))
a, b = map(int, [input() for i in range(2)])
result = 6-a-b
return result

### FIXED CODE ###

a, b = map(int, [input() for i in range(2)])
result = 6-a-b
print(result)
N, W = map(int, input().split())
lst = [[0, 0]] 
for i in range(N):
    lst.append(list(map(int, input().split())))
dp = [[0]*(W+1) for i in range(N+1)]
for i in range(1, N+1):
    for j in range(1, W+1):
        if j - lst[i][0] >= 0:
            dp[i][j] = max(dp[i-1][j], dp[i-1][j-lst[i][0]]+lst[i][1])
        else:
            dp[i][j] = dp[i-1][j]

print(dp[N][W])


### FIXED CODE ###

N, W = map(int, input().split())
lstW = []
lstV = []
for i in range(N):
    w, v = map(int, input().split())
    lstW.append(w)
    lstV.append(v)

dp = [[10**9]*(10**5+1) for _ in range(N+1)]
dp[0][0] = 0
for i in range(N):
    for j in range(10**5+1):
        dp[i+1][j] = min(dp[i+1][j], dp[i][j])
        if dp[i][j] + lstW[i] <= W:
            dp[i+1][j+lstV[i]] = min(dp[i+1][j+lstV[i]], dp[i][j]+lstW[i])
ans = []
for i in range(max(lstV)*N+1):
    if dp[-1][i] <= W:
        ans.append(i)
print(max(ans))
a, b, k = map(int, input().split())
a = list(range(a, b+1))
print(*dict.fromkeys(a[:k] + a[-k:]), sep='\n')


### FIXED CODE ###

a, b, k = map(int, input().split())
l = range(a, b+1)
for i in sorted(set(l[-k:]) | set(l[:k])):
    print(i)
n,m,k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

suma = [0] * n
sumb = [0] * m
suma[0] = a[0]
sumb[0] = b[0]

for i in range(1,n):
    suma[i] = suma[i-1]+a[i]
for j in range(1,m):
    sumb[j] = suma[j-1]+b[j]

ans, cur= 0, m-1
for i in range(n):
    target = k - suma[i]
    for j in range(cur,-1,-1):
        if sumb[j] <= target:
            ans = max(ans, i+j+2)
            cur = j
            break
print(ans)


### FIXED CODE ###

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

suma = [0] * (n)
sumb = [0] * (m)
suma[0] = a[0]
sumb[0] = b[0]

for i in range(1,n):
    suma[i] = suma[i-1]+a[i]
for j in range(1,m):
    sumb[j] = sumb[j-1]+b[j]
    
suma.insert(0,0)
sumb.insert(0,0)

ans, cur = 0, m
for i in range(n+1):
  target = k - suma[i]
  if target < 0:
      break
  while sumb[cur] > target:
      cur -= 1
  ans = max(ans, i+cur)
print(ans)
A = input()
if A = 'A':
    print ('T')
elif A = 'T':
    print ('A')
elif A = 'G':
    print ('C')
else:
    print('G')

### FIXED CODE ###

A = input()
if A == 'A':
    print ('T')
elif A == 'T':
    print ('A')
elif A == 'G':
    print ('C')
else:
    print('G')
N = int(input())
A = [0 for i in range(N)]
for i in range(N):
    A[i] = list(map(str,input().split()))
for i in range(N):
    A[i].append(str(i))


B = sorted(A, key=lambda x: x[1], reverse=True)

C = sorted(B, key=lambda x: x[0])

for i in range(N):
    print(int(C[i][2])+1

### FIXED CODE ###

input_AP = list(map(int, input().split()))
A = input_AP[0]
P = input_AP[1]

result = (A*3 + P)//2
print(result)
K = int(input())
S = input()

if K >= len(S):
  print(S)
else:
  print(S[0:K]+'...')


### FIXED CODE ###

N = input()
if int(N[-1]) == 2 or int(N[-1]) == 4 or int(N[-1]) == 5 or int(N[-1]) == 7 or int(N[-1]) == 9:
  print('hon')
elif int(N[-1]) == 0 or int(N[-1]) == 1 or int(N[-1]) == 6 or int(N[-1]) == 8:
  print('pon')
elif int(N[-1]) == 3:
  print('bon')
import heapq
def makeTree(j):
    global tree
    for x in G[j]:
        if hist[x]==0:
            heapq.heappush(F[tree],(A[x],x,tree))
            hist[x] = 1
            makeTree(x)
N,M = map(int,input().split())
A = list(map(int,input().split()))
G = {i:[] for i in range(N)}
for _ in range(M):
    x,y = map(int,input().split())
    G[x].append(y)
    G[y].append(x)
if M==N-1:
    cost = 0
elif N<2*(N-M-1):
    cost = "Impossible"
else:
    n = N-M
    F = {}
    hist = [0 for _ in range(N+1)]
    tree = 0
    for j in range(N):
        if hist[j]==1:continue
        if tree not in F:F[tree]=[]
        heapq.heappush(F[tree],(A[j],j,tree))
        hist[j] = 1
        makeTree(j)
        tree += 1
    if len(F)!=n:
        cost = "Impossible"
    else:
        cost = 0
        B = [heapq.heappop(F[0])]
        C =sorted([heapq.heappop(F[i]) for i in range(1,n)],key=lambda x:x[0],reverse=True)
        for i in range(n-1):
            b = heapq.heappop(B)
            c = C.pop()
            indb = b[2]
            indc = c[2]
            cost += b[0]+c[0]
            if i==n-2:continue
            heapq.heappush(B,heapq.heappop(F[indb]))
            heapq.heappush(B,heapq.heappop(F[indc]))
print(cost)

### FIXED CODE ###

from collections import deque
import heapq
N,M = map(int,input().split())
A = list(map(int,input().split()))
G = {i:[] for i in range(N)}
for _ in range(M):
    x,y = map(int,input().split())
    G[x].append(y)
    G[y].append(x)
F = []
hist = [0 for _ in range(N)]
for i in range(N):
    T = []
    if hist[i]==0:
        que = deque([i])
        hist[i]=1
        heapq.heappush(T,A[i])
        while que:
            x = que.popleft()
            for y in G[x]:
                if hist[y]==0:
                    que.append(y)
                    hist[y]=1
                    heapq.heappush(T,A[y])
        F.append(T)
K = len(F)
if K>N//2+1:        
    cnt = -1
elif K==1:
    cnt = 0
else:
    cnt = 0
    for i in range(K):
        cnt += heapq.heappop(F[i])
    F1 = []
    for T in F:
        F1 += T
    F1 = sorted(F1)
    for i in range(K-2):
        cnt += F1[i]
if cnt<0:
    print("Impossible")
else:
    print(cnt)
a, b, c, d = [int(i) for i in input().split()]
n = {i for i in range(a, b+1) if i % c != 0 and i % d != 0}4 9 2 3
ans = len(n)
print(ans)

### FIXED CODE ###

import fractions


def anti_division(n, d1, d2):
    g = fractions.gcd(d1, d2)
    l = (d1 * d2) // g
    ret = n - (n//d1 + n//d2) + n//l
    return ret


a, b, c, d = [int(i) for i in input().split()]
ans = anti_division(b, c, d) - anti_division(a - 1, c, d)
print(ans)
X,Y=map(int,input().split())
t=X
for i in range(1,X*Y):
    if t*2>Y: break
    else:
        t*=2

print(i)


### FIXED CODE ###

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

i=1
A=[]
A.append(X)

while(1):
    T=A[i-1]*2
    if T<=Y:
        A.append(T)
    elif T>Y:
        break
    i+=1

print(len(A))
if ((a*b) % 2 == 0):
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

a, b = map(int, input().split())
if a*b % 2 == 0 :
  print("Even")
else:
  print("Odd")
*s,=map(int,open(0));print(-~sum(s)//2)

### FIXED CODE ###

import math
a,b=map(int,input().split())
print(math.ceil((a+b)/2))
x,y=input().split()
print('<' if x<y '=' if x==y else '>')

### FIXED CODE ###

x,y=input().split()
print('<' if x<y else '=' if x==y else '>')