Harryxun/stf_run huggingface dataset:
N, M, X, Y = map(int, input().split())
x=list(map(int, input().split()))
y=list(map(int, input().split()))

if max(x)<min(y):
  for i in range(max(x)+1,min(y)+1)
    if i>X and i<=Y:
      print('No War')
      break
  else
    print('War')
else:
  print('War')

### FIXED CODE ###

N, M, X, Y = map(int, input().split())
x=list(map(int, input().split()))
y=list(map(int, input().split()))

if max(x)<min(y):
  for i in range(max(x)+1,min(y)+1):
    if i>X and i<=Y:
      print('No War')
      break
  else:
    print('War')
else:
  print('War')
N, M = map(int, input().split())
A = list(map(int, input().split()))
ops = [list(map(int, input().split())) for _ in range(M)]
A.sort()
ops.sort(key=lambda x:x[1], reverse=True)

a_index = 0
for op in ops:
    b, c = op
    tail = min(a_index+b, N)
    for i in range(a_index, a_index+b):
        if A[i] > c:
            a_index = None
            break
        A[i] = c
    else:
        a_index += b
    if a_index is None:
        break
    if a_index >= N:
        break

print(sum(A))

### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
ops = [list(map(int, input().split())) for _ in range(M)]
A.sort()
ops.sort(key=lambda x:x[1], reverse=True)

a_index = 0
for op in ops:
    b, c = op
    tail = min(a_index+b, N)
    for i in range(a_index, a_index+b):
        if i >= N:
            a_index = None
            break
        if A[i] > c:
            a_index = None
            break
        A[i] = c
    else:
        a_index += b
    if a_index is None:
        break

print(sum(A))
input_a = input()

if input_a[0]　!= 'A':
    print("WA")
elif input_a.count('C')==0:
    print("WA")
elif input_a.count('C')>1:
    print("WA")
elif input_a.index('C') ==1:
    print("WA")
elif input_a.index('C') ==len(input_a)-1:
    print('WA')
elif input_a.count('C') ==1:
    if input_a.strip("A").strip('C').islower():
        print('AC')
    else:
        print('WA')

### FIXED CODE ###

input_a = input()
if input_a[0] != 'A':
    print("WA")
elif input_a.count('C')==0:
    print("WA")
elif input_a.count('C')>1:
    print("WA")
elif input_a.index('C') <=1:
    print("WA")
elif input_a.index('C') ==len(input_a)-1:
    print('WA')
elif input_a.count('C') ==1:
    if input_a.replace('A','a').replace('C','c').islower():
        print('AC')
    else:
        print('WA')
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
for i in range(X, Y+1):
   if X < i <= Y and max(x) < i <= min(y):
             print("No War")
             exit(1)
print("War")
             


### FIXED CODE ###

N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
for i in range(X, Y+1):
  if X < i <= Y and max(x) < i <= min(y):
    print("No War")
    exit()
print("War")
aaaaaaaaaaaaaaaaaaaa

### FIXED CODE ###

n = int(input())
s = input()
h = n // 2
if s[:h] == s[h:]:
  print('Yes')
else:
  print('No')
n = int(input())

m = n[-1]

if m == 3:
    print('bon')
elif m == 0,1,6,8:
    print('pon')
else:
    print('hon')

### FIXED CODE ###

n = input()

m = (n[-1])

if m == '3':
    print('bon')
elif m == '0' or m == '1' or m =='6' or m =='8':
    print('pon')
else:
    print('hon')
import math

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

mi_stamina = math.inf
for i in range(-1000, 1000):
    double_list = list(map(lambda x: (x-i)**2, x_list))
    stamina = sum(double_list)
    if mi_stamina > stamina:
        mi_stamina = stamina

print(mi_stamina)

### FIXED CODE ###

import math


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


mi_stamina = 1000000000
for i in range(-1000, 1000):
    def _distance(x):
        return (x-i)**2
    double_list = list(map(_distance, x_list))
    stamina = sum(double_list)
    if mi_stamina > stamina:
        mi_stamina = stamina

print(mi_stamina)
from functools import reduce
from fraction import *

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

def gcd_list(numbers):
    return reduce(gcd, numbers)

ans = 1
for i in range(len(A)):
    l = A.copy()
    l.pop(i)
    ans = max(ans,gcd_list(*l))

print(ans)



### FIXED CODE ###

from fractions import gcd
import math
N = int(input())
A = list(map(int, input().split()))

gl = [0] * (N-1)
gr = [0] * (N-1)

gl[0] = A[0]
gr[0] = A[-1]
for i in range(1,N-1):
    gl[i] = gcd(gl[i-1],A[i])
    gr[i] = gcd(gr[i-1],A[-i-1])
#print(gl[i])
ans = max(gr[-1],gl[N-2])
for i in range(1,N-1):
    g = gcd(gl[i-1],gr[-i-1])
    ans = max(ans,g)
#print(gl,gr)
print(ans)
A, B, C = map(int, input().split())
if C => A and C <= B:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

A, B, C = map(int, input().split())
if A > B:
  if C < A and C > B:
    print("Yes")
  else:
    print("No")
else:
  if C > A and C < B:
    print("Yes")
  else:
    print("No")
N = int(input())
ans = "No"
for i in range(1,10):
  for j in range(1,10):
    if N = i*j:
      ans = "Yes"
      break
print(ans)

### FIXED CODE ###

N = int(input())
ans = "No"
for i in range(1,10):
  for j in range(1,10):
    if N == i*j:
      ans = "Yes"
      break
print(ans)
n = int(input())
array = [int(input()) for i in range(n)]
def shift_only(array):
    tmp = []
    counter = 0
    while True:
        flag = True
        for num in array:
            if num%2 != 0:
                flag = False
        if flag == False:
            break
        array = [i/2 for i in array]
        counter +=1
    print(counter)
shift_only(array)

### FIXED CODE ###

string = input()
counter = 0
for ele in string:
    if ele == "1":
        counter += 1
print(counter)
n,k = map(int,input().split())

k = k // 2
x = n // k
if x % 2 == 0:
    ans = 2 * (x / 2) ** 3
else:
    ans = ((x // 2) + 1) ** 3 + (x // 2) ** 3

print(int(ans))

### FIXED CODE ###

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

if k % 2 == 1:
    print((n//k) ** 3)
else:
    print((n//k) ** 3 + ((n-k//2)//k+1)**3)
n,k = map(input().split())
p = map(input)
print(sum(p,:k)

### FIXED CODE ###

n, k = map(int,input().split())
p = list(map(int, input().split()))
p.sort()
print(sum(p[:k]))
N=int(input())
p=0
while N%==0:
    p+=1
    N//=2
print(2**p)

### FIXED CODE ###

N=int(input())
if N<2:
    x=1
elif N<4:
    x=2
elif N<8:
    x=4
elif N<16:
    x=8
elif N<32:
    x=16
elif N<64:
    x=32
else:
    x=64
print(x)
n,m = map(int,input().split())
ans = [-1] * n
edge = [[] for _ in range(n)]

for _ in range(m):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    edge[a].append(b)
    edge[b].append(a)
    
import collections
que = collections.deque()
que.append(0)
    
while que:
    x = que.popleft()
    
    for to in edge[x]:
        if ans[to] == -1:
            ans[to] = x + 1
            que.append(to)
            
print("Yes")
print(*ans[1:],sep="\n")

### FIXED CODE ###

n = int(input())

if n % 10 == 3:
    print("bon")

elif n % 10 in [0,1,6,8]:
    print("pon")
    
else:
    print("hon")
n = []
while True:
    try:
        n=(input())
    except EOFError:
        break
print(1000-int(n[1:4]))

### FIXED CODE ###

n=int(input())
print((1000-n%1000)%1000)
from sys import stdin
def main():
    A = list(map(int,stdin.readline().replace('B', '0').replace('W', '1')))

    wc = A.count(1)
    indices = [i for i, x in enumerate(A) if x == 1]
    print(sum(indices) - 1*wc*(wc-1) //2 )

input = lambda: stdin.readline()
main()


### FIXED CODE ###

from sys import stdin

def main():
    A=stdin.readline().replace('B', '0').replace('W', '1')
    #A=list(map(int,bw))
    #A = list(map(int,stdin.readline().replace('B', '0').replace('W', '1')))

    wc = A.count('1')
    indices = [i for i, x in enumerate(A) if x == '1']
    if wc > 0:
      print(sum(indices) - 1*wc*(wc-1) //2 )
    else:
      print(sum(indices))

input = lambda: stdin.readline()
main()
R=int(input())
    print(R*2*3.141)

### FIXED CODE ###

R=int(input())
pai=3.14
print(R*2*pai)
N, A, B = map(int, input().split())
print(min((N//(A+B))A + N-(N//(A+B), (N//(A+B))A + A))

### FIXED CODE ###

N, A, B = map(int, input().split())
print(min((N//(A+B))*A + N - (N//(A+B))*(A+B), (N//(A+B))*A + A))
print (len(set(input.split())))

### FIXED CODE ###

print (len(set(input().split())))
import numpy as np
L, R = list(map(int, input().split(' ')))
x = []
x.append(L % 2019)
for i in range(L+1, R+1):
    m = i % 2019
    if s == m:
        break
    x.append(m)
min_v = 2018
for i in range(0, len(x)-1):
    tmp = np.amin(np.mod([x[i]*x[j] for j in range(i+1, len(x))], 2019))
    if tmp < min_v:
        min_v = tmp

print(min_v)

### FIXED CODE ###

import numpy as np
L, R = list(map(int, input().split(' ')))
x = []
x.append(L % 2019)
for i in range(L+1, R+1):
    m = i % 2019
    if x[0] == m:
        break
    x.append(m)
    
min_v = 2018
for i in range(0, len(x)-1):
    tmp = np.amin(np.mod([x[i]*x[j] for j in range(i+1, len(x))], 2019))
    if tmp < min_v:
        min_v = tmp

print(min_v)
def find_min_fuka_idx(lst, x):
  ok = -1
  ng = len(lst)
  while abs(ok-ng)>1:
    mid = (ok+ng)//2
    if x>=lst[mid]:
      ok = mid
    else:
      ng = mid
  return ng

a,b,q = map(int, input().split())
s = [-10**18]
s_mid = [int(input()) for i in range(a)]
s.extend(s_mid)
s.append(10**18)
  
t = [-10**18]
t_mid = [int(input()) for i in range(b)]
t.extend(t_mid)
t.append(10**18)
x = [(int(input()), i) for i in range(q)]
x = sorted(x)
si = 1
tj = 1
ans = []
for i in range(q):
  si = find_min_fuka_idx(s[si-1:], x[i][0])
  tj = find_min_fuka_idx(t[tj-1:], x[i][0])
  ssi = s[si]
  ssi1 = s[si-1]
  ttj = t[tj]
  ttj1 = t[tj-1]
  ans.append((min(abs(x-ssi)+abs(ssi-ttj),\
            abs(x-ssi)+abs(ssi-ttj1),\
           abs(x-ttj)+abs(ttj-ssi),\
            abs(x-ttj)+abs(ttj-ssi1),\
            abs(x-ssi1)+abs(ssi1-ttj),\
            abs(x-ssi1)+abs(ssi1-ttj1),\
           abs(x-ttj1)+abs(ttj1-ssi),\
            abs(x-ttj1)+abs(ttj1-ssi1)), x[i][1]))

ans = sorted(ans, key=lambda p: p[1])
for p in range(q):
  print(ans[p])


### FIXED CODE ###

import bisect
def find_min_fuka_idx(lst, x):
  ok = -1
  ng = len(lst)
  while abs(ok-ng)>1:
    mid = (ok+ng)//2
    if x>=lst[mid]:
      ok = mid
    else:
      ng = mid
  return ng

a,b,q = map(int, input().split())
s = [-10**18]
s_mid = [int(input()) for i in range(a)]
s.extend(s_mid)
s.append(10**18)

t = [-10**18]
t_mid = [int(input()) for i in range(b)]
t.extend(t_mid)
t.append(10**18)

for i in range(q):
  x = int(input())
  si = bisect.bisect_right(s, x)
  tj = bisect.bisect_right(t, x)
  print(min(abs(x-s[si])+abs(s[si]-t[tj]),\
            abs(x-s[si])+abs(s[si]-t[tj-1]),\
           abs(x-t[tj])+abs(t[tj]-s[si]),\
            abs(x-t[tj])+abs(t[tj]-s[si-1]),\
            abs(x-s[si-1])+abs(s[si-1]-t[tj]),\
            abs(x-s[si-1])+abs(s[si-1]-t[tj-1]),\
           abs(x-t[tj-1])+abs(t[tj-1]-s[si]),\
            abs(x-t[tj-1])+abs(t[tj-1]-s[si-1])))
# input
K, S = map(int, input())

ans = 0

for i in range(K + 1):
    for j in range(S - i + 1):
        for k in range(S - i - j + 1):
            if i + j + k == S:
                ans += 1

print(ans)

### FIXED CODE ###

# input
K, S = map(int, input().split())

ans = 0

for i in range(min([S + 1, K + 1])):
    for j in range(min([S -i + 1, K + 1])):
        if S - i - j <= K:
            ans += 1

print(ans)
print(a + a ** 2 + a ** 3)

### FIXED CODE ###

a=int(input())
print(a+a**2+a**3)
def t(n):
    if n==1:
        return 1
    return n*t(n-1)
print(t(int(input()))%(10**9+7))

### FIXED CODE ###

n=int(input())
r=1
for i in range(1,n+1):
    r=r*i%(10**9+7)
print(r)
W,H,x,y,r=map(int,input().split())

print "Yes" if (W>=(x+r)) and (H>=(y+r)) else "No"

### FIXED CODE ###

W,H,x,y,r=map(int,input().split())

if W>=(x+r) and r<=x:
 if H>=(y+r) and r<=y:
  print('Yes')
 else:
  print('No')
else:
 print('No')
n =	int(input())
nums = [int(input()) for i in range(n)]

num_max = max(nums)
next_max = num_max

for idx, el in enumerate(nums):
	del nums[idx]
	if num_max == el:
		if next_max == num_max
			next_max = max(nums)
			print(next_max)
		else:
			print(next_max)
		
	else:
		print(num_max)
	nums.insert(idx, el)



### FIXED CODE ###

import numpy as np

n =	int(input())
nums = [int(input()) for i in range(n)]

num_max = np.max(nums)
next_max = sorted(nums)[-2]


for idx, el in enumerate(nums):
	if num_max == el:
		print(next_max)		
	else:
		print(num_max)
n = int(input())
s = [input() for i in range(n)]

m = int(input())
t = [input() for i in range(m)]

ans = 0
for str in s: 
    cou = s.oount(str) - t.count(str) 
    ans = max(cou, ans)

print(ans)
    

    


### FIXED CODE ###

n = int(input())
s = [input() for i in range(n)]

m = int(input())
t = [input() for i in range(m)]

ans = 0
for str in s: #strは単語を表している。ループの回数としてはn回（sの配列数）
    cou = s.count(str) - t.count(str) #sの中にstr（たとえばapple)が何個あるか、tの中に同じく　str（spple)が何個あるか調べて引いてる。
    ans = max(cou, ans)

print(ans)
h, n = map(int,input().split())
a = list(map(int,input().split()))
l = []

for i in range(5):
  for j in range(5):
    if a[i] + a[j] >= h:
      l.append(1)
    else:
      l.append(0)

print('Yes' if sum(l) > 0 else 'No')

### FIXED CODE ###

h, n = map(int,input().split())
a = list(map(int,input().split()))
print('Yes' if sum(a) >= h else 'No')
n , k = map(int, input().split())
a = list(map(int, input().split()))
neg = []
pos = []
mod = 10**9+7
for i in range(n):
    if a[i] >= 0:
        pos.append(a[i])
    else:
        neg.append(a[i])
neg.sort()
pos.sort(reverse = True)
min_num = -1
good_num = -1
if k % 2 == 1 and len(pos) == 0:
    ans = 1
    neg.sort(reverse = True)
    for i in range(k):
        ans *= neg[i]
        ans %= mod
    print(ans)
else:
    #最大化するとき
    for i in range(0,k+1,2):
        #i個だけnegから取る。
        if i > len(neg) or k - i > len(pos):
            continue
        m = 0
        if i != 0:
            m = abs(neg[i-1])
        if k-i-1 != 0:
            m = min(m, pos[k-i-1])
        if m > min_num:
            min_num = m
            good_num = i
    ans = 1
    for i in range(good_num):
        ans *= neg[i]
        ans %= mod
    for i in range(k - good_num):
        ans*= pos[i]
        ans %= mod
    print(ans % mod)

### FIXED CODE ###

n , k = map(int, input().split())
a = list(map(int, input().split()))
neg = []
pos = []
mod = 10**9+7
for i in range(n):
    if a[i] >= 0:
        pos.append(a[i])
    else:
        neg.append(a[i])
neg.sort()
pos.sort(reverse = True)
if (len(pos) == 0 and k % 2 == 1) or n == k:
    ans = 1
    a.sort(reverse = True)
    for i in range(k):
        ans *= a[i]
        ans %= mod
    print(ans % mod)
else:
    #最大化するとき
    from collections import deque
    ans = 1
    neg_new = []
    for i in range(0, len(neg)//2):
        neg_new.append(neg[2*i] * neg[2*i+1])
    neg_new = deque(sorted(neg_new, reverse = True))
    pos = deque(pos)
    if k % 2 == 1:
        k -= 1
        ans = pos.popleft()
    else:
        ans = 1
    while k > 0:
        if len(pos) >= 2 and len(neg_new) >= 1:
            if pos[0] * pos[1] > neg_new[0]:
                ans *= pos.popleft() * pos.popleft()
            else:
                ans *= neg_new.popleft()
        elif len(pos) >= 2:
            ans *= pos.popleft() * pos.popleft()
        else:
            ans *= neg_new.popleft()
        k -= 2
        ans %= mod
    print(ans % mod)
# -*- coding: utf-8 -*-
 
N = int(raw_input())
ans = 0
 
a = []
b = []
c = []
for i in range(N):
    a.append(map(int, raw_input().split()))
    b.append(map(int, raw_input().split()))
    c.append(map(int, raw_input().split()))
print(a)
print(b)
print(c)
for i in range(N):
	if a[i+1] - a[i] == 1:
  		ans += c[i]
    
ans += sum(b)
 
print(int(ans))


### FIXED CODE ###

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

N = int(raw_input())

C = N*N*N

print(C)
import numpy as np

n = int(input())
a = [int(i) for i in input().split()] 
ans = np.array(a)
x = np.zeros(n)

s = (n,n)
M = np.matrix(np.zeros(s))
for i in range(n):
    vec = np.zeros(n)
    vec[i]=1/2
    if i == (n-1):
        vec[0]=1/2
    else:
        vec[i+1]=1/2
    M[i] = vec
ans = (np.linalg.inv(M)*(ans.reshape(-1,1)))
print(' '.join(map(str, map(int, ans.T.tolist()[0]))))

### FIXED CODE ###

import numpy as np

n = int(input())
a = [int(i) for i in input().split()] 
a = np.array(a)
x = np.zeros(n)

x[0] = sum(a) - (2*(sum(a[1::2])))

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

print(' '.join(map(str, map(int, x))))
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
input = sys.stdin.readline
INF = float("inf")


def dfs(G, visited, v, cnt):
    visited[v] = True
    cnt += 1

    for nv in G[v]:
        if visited[nv]:
            continue
        cnt = dfs(G, visited, nv, cnt)
    
    return cnt


# 処理内容
def main():
    N, M = map(int, input().split())

    if M == 0:
        print(1)
        return

    P = set()
    for _ in range(M):
        a, b = map(int, input().split())
        a -= 1; b -= 1
        if a > b:
            a, b = b, a
        P.add((a, b))

    G = [[] for _ in range(N)]
    for pair in P:
        a, b = pair
        G[a].append(b)
        G[b].append(a)

    visited = [False] * N
    ans = 0
    for i in range(N):
        if visited[i]:
            continue
        ans = max(ans, dfs(G, visited, 0, 0))
    print(ans)


if __name__ == '__main__':
    main()

### FIXED CODE ###

from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10000000)
input = sys.stdin.readline
INF = float("inf")


def dfs(G, visited, v, cnt):
    visited[v] = True

    for nv in G[v]:
        if visited[nv]:
            continue
        cnt = dfs(G, visited, nv, cnt + 1)
    
    return cnt


# 処理内容
def main():
    N, M = map(int, input().split())

    if M == 0:
        print(1)
        return

    P = set()
    for _ in range(M):
        a, b = map(int, input().split())
        a -= 1; b -= 1
        if a > b:
            a, b = b, a
        P.add((a, b))

    G = [[] for _ in range(N)]
    for pair in P:
        a, b = pair
        G[a].append(b)
        G[b].append(a)

    visited = [False] * N
    ans = 1
    for i in range(N):
        if visited[i]:
            continue
        tmp = dfs(G, visited, i, 1)
        ans = max(ans, tmp)
    print(ans)


if __name__ == '__main__':
    main()
_ = input()
A = [int(i) for i in input().split(" ")]
for i in range(1, len(A)):
  print(" ".join(A))
  key = A[i]
  j = i - 1
  while j >= 0 and A[j] > key:
    A[j + 1] = A[j]
    j -= 1
  A[j + 1] = key

### FIXED CODE ###

_ = input()
A = [int(a) for a in input().split(" ")]
for i in range(1, len(A)):
  print(" ".join([str(a) for a in A]))
  key = A[i]
  j = i - 1
  while j >= 0 and A[j] > key:
    A[j + 1] = A[j]
    j -= 1
  A[j + 1] = key
print(" ".join([str(a) for a in A]))
s = input()
k = int(input())
i = 0
while i < k and s[i] == '1':
    i += 1
print(s[i])


### FIXED CODE ###

s = input()
k = int(input()) - 1
i = 0
while i < k and s[i] == '1':
    i += 1
print(s[i])
n = int(input())
a = list(map(int,input().split()))
a.sort()
else:
  print(a[n//2]-a[n//2-1])

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
a.sort()
print(a[n//2]-a[n//2-1])
N = int(input())
A = [int(i) for i in input().split()]
for i in range(N):
    A[i] *= 2
import numpy as np
mat = [[0] * N for _ in range(N)]
for i in range(N):
    j = i + 1
    if j == N:
        j = 0
    mat[i][i] = 1
    mat[i][j] = 1
AB = np.array(mat)
inv_A = np.linalg.inv(AB)
ans = list(np.dot(inv_A,A))
for i in range(N):
    ans[i] = int(ans[i])
print(*ans)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=[sum(a)-2*sum(a[1:n-1:2])]
for i in range(1,n):
  b.append(2*a[i-1]-b[-1])
print(*b)
class UnionFind:
    def __init__(self, n):
        self.rank = [0]*n
        self.parent = [i for i in range(n)]
    
    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            self.parent[x] = self.find(self.parent[x])
            return self.parent[x]
    
    def merge(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.rank[x] < self.rank[y]:
            self.parent[y] = x
        elif self.rank[x] > self.rank[y]:
            self.parent[x] = y
        else:
            self.parent[x] = y
            self.rank[y] += 1
    
    def same(self, x, y):
        return self.find(x) == self.find(y)

n, q = map(int, input().split())
uf = UnionFind(n)
for i in range(q):
    com, x, y = map(int, input().split())
    
    if com == 0:
        uf.merge(x, y)
    else:
        print(1 if uf.same(x, y) else 0)


### FIXED CODE ###

class UnionFind:
    def __init__(self, n):
        self.rank = [0]*n
        self.parent = [i for i in range(n)]

    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            self.parent[x] = self.find(self.parent[x])
            return self.parent[x]

    def merge(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.rank[x] < self.rank[y]:
            self.parent[x] = y
        elif self.rank[x] > self.rank[y]:
            self.parent[y] = x
        else:
            self.parent[x] = y
            self.rank[y] += 1

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

n, q = map(int, input().split())
uf = UnionFind(n)
for i in range(q):
    com, x, y = map(int, input().split())

    if com == 0:
        uf.merge(x, y)
    else:
        print(1 if uf.same(x, y) else 0)
a_1=list(map(int, input().split()))
a_2=list(map(int, input().split()))
a_3=list(map(int, input().split()))

c=[a_1,a_2,a_3]

N=int(input())

b=[int(input()) for _ in range(N)]

for i in range(3):
    for j in range(3):
        if a[i][j] in b:
            a[i][j]=0
            
            
i=0
if a[0][0]==0 and a[0][1]==0 and a[0][2]:
    i+=1
if a[1][0]==0 and a[1][1]==0 and a[1][2]:
    i+=1
if a[2][0]==0 and a[2][1]==0 and a[2][2]:
    i+=1
if a[0][0]==0 and a[1][0]==0 and a[2][0]:
    i+=1
if a[0][1]==0 and a[1][1]==0 and a[2][1]:
    i+=1
if a[0][2]==0 and a[1][2]==0 and a[2][2]:
    i+=1
if a[0][0]==0 and a[1][1]==0 and a[2][2]:
    i+=1
if a[0][2]==0 and a[1][1]==0 and a[2][0]:
    i+=1
    
if i>0:
    print("Yes")
elif i==0:
    print("No")

### FIXED CODE ###

import numpy as np
N_1=list(map(int, input().split()))
N_2=list(map(int, input().split()))
N_3=list(map(int, input().split()))
N=int(input())
a=[int(input()) for i in range(N)]

n=np.array([N_1,N_2,N_3])

for a_n in a:
    if a_n in n:
        n[n==a_n]=0
    else:
        pass
i=0
    
if np.all(n[0:,0]==0)==True:
    i=+1
    
elif np.all(n[0:,1]==0)==True:
    i+=1
    
elif np.all(n[0:,2]==0)==True:
    i+=1
    
elif np.all(n[0,0:]==0)==True:
    i+=1
    
elif np.all(n[1,0:]==0)==True:
    i+=1

elif np.all(n[2,0:]==0)==True:
    i+=1

elif n[0,0]==0 and n[1,1]==0  and n[2,2] ==0:
    i+=1
    
elif n[0,2]==0 and n[1,1]==0 and n[2,0] ==0:
    i+=1
    
if i>0:
    print("Yes")
else:
    print("No")
import math
mod = 10**9+7

def comb(n, r):
  return (math.factorial(n)) / (math.factorial(n-r)) / (math.factorial(r))

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


for i in range(1, k+1):
  if i <= n-k+1:
    ans = comb(n-k+1, i)%mod * comb(k-1, i-1)%mod
    ans %= mod
  else:
    ans = 0
  print(int(ans))

### FIXED CODE ###

import math
from operator import mul
from functools import reduce

def comb(n, r):
  r = min(r, n-r)
  if r==0: return 1
  over = reduce(mul, range(n, n-r, -1))
  under = reduce(mul, range(1, r+1))
  return over//under

n, k = map(int, input().split())
mod = 10**9+7

for i in range(1, k+1):
  if i <= n-k+1:
    ans = comb(n-k+1, i) * comb(k-1, i-1)
    ans %= mod
  else:
    ans = 0
  print(ans)
import math
r = int(input())
s=r**2*math.pi
l=2*r*math.pi
print('{:.6f} {:.6f}'.format(s,l))

### FIXED CODE ###

import math
r = float(input())
s=r**2*math.pi
l=2*r*math.pi
print('{:.6f} {:.6f}'.format(s,l))
N = int(input())
table = set()
for i in range(N):
    table.add(int(input()))
print(sum(table[:]) - max(table) * // 2)

### FIXED CODE ###

N = int(input())
p = [int(input()) for _ in range(N)]
p = sorted(p)
print(sum(p[:]) - p[-1]//2)