Harryxun/stf_run huggingface dataset:
A,B,M = map(int, input().split())

la = list(map(int, input().split()))
lb = list(map(int, input().split()))

d = []
for i in range(M):
  d.append(list(map(int, input().split())))
           
for i in range(M):
  d[i] = la[(d[i][0]-1)] + lb[(d[i][1]-1)] - d[i][2]
  
o = min(la) + min(lb)
d.append(o)

print(min(d))

### FIXED CODE ###

h = input()
l = len(h)
n = 0
hitachi = False

if l % 2 == 1:
  hitachi = False
  
else:
  m = int(l / 2)
  for i in range(m):
    if h[(2 * i)] == "h":
      n += 1
    if h[(2 * i)+1] == "i":
      n += 1
  
  if n == l:
    hitachi = True
  else:
    hitachi = False
    
if hitachi:
  print("Yes")
else:
  print("No")
import sys
import math
import itertools
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

N = i()
h = l()
ans = 0
start = 0
Flag = 0
for i in range(N-1):
    if h[i] > h[i+1]:
        Flag = 1
    if h[i] < h[i+1] and Flag == 1:
        kukan = h[start:i+1]
        ans -= h[i]
        ans += max(kukan)
        start = i+1
        Flag = 0
kukan = h[start:-1]
ans += max(kukan)
print(ans)

### FIXED CODE ###

import sys
import math
import itertools
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

N = i()
h = l()
ans = 0
start = 0
Flag = 0
for i in range(N-1):
    if h[i] > h[i+1]:
        Flag = 1
    if h[i] < h[i+1] and Flag == 1:
        kukan = h[start:i+1]
        ans -= h[i]
        ans += max(kukan)
        start = i+1
        Flag = 0
kukan = h[start:N]
ans += max(kukan)
print(ans)
import itertools
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=sorted([x[0]*x[1] for x in itertools.combinations(a,2)],reverse=False)
print(b[k-1])

### FIXED CODE ###

a,b,c=map(int,input().split())
d=set([a,b,c])
if len(d)==2:
  print("Yes")
else:
  print("No")
n,m = map(int,input().split())
lst = [list(map(int,input().split())) for _ in range(n)]

lst.sort(key = lambda x:x[0],reverse = True)
lst.sort(key = lambda x:x[1],reverse = True)

done = [0 for _ in range(n)]
gain = 0

for i in reversed(range(1,m+1)): #i:残り日数
    for j in range(n): #j:候補から優先度順で探索
        if lst[j][0] <= i and done[j] == 0: #必要な日数>残り日数 かつ undone
            gain += lst[j][1]
            done[j] = 1　#undone:0,done:1として分類
            break #働いたら次の日へ

print(gain)

### FIXED CODE ###

import heapq
n,m = list(map(int,input().split()))
jobs = [[] for _ in range(m)]
for i in range(n):
    d,r = list(map(int,input().split()))
    if d-1 < m:
        jobs[d-1].append(-r)
rewords = 0
heap = []
for i in range(m):
    for reword in jobs[i]:
        heapq.heappush(heap,reword)
    if len(heap) > 0:
        reword = heapq.heappop(heap)
        rewords += -reword
print(rewords)
while True:
	x = list(int(i) for i in input().split())
	x.sort()
	print(x[0],x[1],sep=" ")


### FIXED CODE ###

while True:
	x = list(int(i) for i in input().split())
	if x[0] == 0 and x[1] == 0:
		break;
	x.sort()
	print(x[0],x[1],sep=" ")
from fractions import Fraction
import sys
input = sys.stdin.readline
def powmod(x, n,mod):
  if n == 0:
   return 1
  K = 1
  while n > 1:
   if n % 2 != 0:
    K = K * x%mod
    x = x ** 2%mod
    n = (n - 1) // 2
   else:
    x = x ** 2%mod
    n = n // 2%mod

  return K * x # 指数を割り続け n が 1 に至ったら終了
N=int(input())
mod=10**9+7
dic={}
dica={}
c=0
d=0
for i in range(N):
 A,B = map(int,input().split())
 if A==0 and B==0:
  continue
 elif A==0:
  c+=1
 elif B==0:
  d+=1
 else:
   x=Fraction(A,B)
   if x>0:
    if x in dic:
     dic[x]+=1
    else:
     dic[x]=1
   else:
    if x in dic:
     dica[x]+=1
    else:
     dica[x]=1
 ans=1
for k in dic:
 if -1/k in dica:
   ans*=(powmod(2,dic[k],mod)+powmod(2,dica[-1/k],mod) -1)
   ans%=mod
 else:
   ans*=powmod(2,dic[k],mod)
   ans%=mod
for k in dica:
 if -1/k in dic:
  continue
 else:
  ans*=powmod(2,dica[k],mod)
  ans%=mod
ans*=(powmod(2,c,mod)+powmod(2,d,mod)-1)
ans%=mod
print(ans-1)


### FIXED CODE ###

from collections import defaultdict
from math import gcd
import sys
input = sys.stdin.readline
N=int(input())
mod=10**9+7
dic=defaultdict(lambda: [0,0])
c=0
d=0
e=0
for i in [0]*N:
 A,B = map(int,input().split())
 if A==0 and B==0:
  e+=1
 elif A==0:
  c+=1
 elif B==0:
  d+=1
 else:
  g=gcd(A,B)
  A//=g
  B//=g
  if A*B>0:
   dic[(abs(A),abs(B))][0]+=1
  else:
   dic[(abs(B),abs(A))][1]+=1
ans=1
for k in dic:
 ans=ans*(pow(2,dic[k][0],mod)+pow(2,dic[k][1],mod) -1)
ans=ans*(pow(2,c,mod)+pow(2,d,mod)-1)
print((ans-1+e)%mod)
h,n=map(int,input().split())

a=[]
b=[]
INF=10**9
dp=[INF for i in range(h+1)]

for i in range(n):
  p,q=map(int,input().split())
  a.append(p)
  b.append(q)


for i in range(n):
  if a[i]<=h:
    dp[a[i]]=b[i]
  else:
    dp[h]=min(dp[h],b[i])
    flag=1

if flag==0:
  for i in range(1,h+1):
    if dp[i]==INF:
      #dp[i]=min(dp[i],dp[i-1])
      #print(dp)
      continue
    for j in range(n):
      if i+a[j]<=h:
        dp[i+a[j]]=min(dp[i+a[j]],dp[i]+b[j])
        #print(dp)
      else:
        dp[h]=min(dp[h],dp[i]+b[j])
        #print(dp)
    #dp[i]=min(dp[i],dp[i-1])
    #print(dp)
print(dp[h])

### FIXED CODE ###

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

a=[]
b=[]
INF=10**9
dp=[INF for i in range(h+10**4)]

for i in range(n):
  p,q=map(int,input().split())
  a.append(p)
  b.append(q)

dp[0]=0
for i in range(h):
  if dp[i]==INF:
    continue
  for j in range(n):
    if dp[i+a[j]]>=dp[i]+b[j]:
      dp[i+a[j]]=dp[i]+b[j]
print(min(dp[h:]))
A,B=map(int,input().split())
if A==1 or B==1:
  if A==B:
    print('Draw')
  elif A=1:
    print('Alice')
  else:
    print('Bob')
elif A>B:
  print('Alice')
elif A<B:
  print('Bob')
else:
  print('Draw')

### FIXED CODE ###

A,B=map(int,input().split())
if A==1 or B==1:
  if A==B:
    print('Draw')
  elif A==1:
    print('Alice')
  else:
    print('Bob')
elif A>B:
  print('Alice')
elif A<B:
  print('Bob')
else:
  print('Draw')
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
N = int(input())
b = []
for _ in range(N):
    b.append(input())

bingo1 =[0,0,0]
bingo2 =[0,0,0]
bingo3 =[0,0,0]
for i in range(3):
    for j in range(N):
        if A1[i]=b[j]:
            bingo1[i]+=1
        if A2[i]=b[j]:
            bingo2[i]+=1
        if A3[i]=b[j]:
            bingo3[i]+=1
if bingo1[0] == 1 and bingo1[1] == 1 and bingo1[2] == 1:
    print("Yes")
elif bingo2[0] == 1 and bingo2[1] == 1 and bingo2[2] == 1:
    print("Yes")
elif bingo3[0] == 1 and bingo3[1] == 1 and bingo3[2] == 1:
    print("Yes")
elif bingo1[0] == 1 and bingo2[0] == 1 and bingo3[0] == 1:
    print("Yes")
elif bingo1[1] == 1 and bingo2[1] == 1 and bingo3[1] == 1:
    print("Yes")
elif bingo1[2] == 1 and bingo2[2] == 1 and bingo3[2] == 1:
    print("Yes")
elif bingo1[1] == 1 and bingo2[2] == 1 and bingo3[3] == 1:
    print("Yes")
elif bingo1[3] == 1 and bingo2[2] == 1 and bingo3[1] == 1:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
N = int(input())
b = [(int(input())) for _ in range(N)]

bingo1 =[0,0,0]
bingo2 =[0,0,0]
bingo3 =[0,0,0]
for i in range(3):
    for j in range(N):
        if A1[i]==b[j]:
            bingo1[i]=1
        elif A2[i]==b[j]:
            bingo2[i]=1
        elif A3[i]==b[j]:
            bingo3[i]=1    


            
if bingo1[0] == bingo1[1] == bingo1[2] == 1:
    print("Yes")
elif bingo2[0] == bingo2[1] == bingo2[2] == 1:
    print("Yes")
elif bingo3[0] == bingo3[1] == bingo3[2] == 1:
    print("Yes")
elif bingo1[0] == bingo2[0] == bingo3[0] == 1:
    print("Yes")
elif bingo1[1] == bingo2[1] == bingo3[1] == 1:
    print("Yes")
elif bingo1[2] == bingo2[2] == bingo3[2] == 1:
    print("Yes")
elif bingo1[0] == bingo2[1] == bingo3[2] == 1:
    print("Yes")
elif bingo1[2] == bingo2[1] == bingo3[0] == 1:
    print("Yes")
else:
    print("No")
H, W, M = map(int, input().split())
bom = [list(map(int, input().split())) for _ in range(M)]

hBom = [0]*H
wBom = [0]*W

# 各行、各列の爆破対象をカウント
for h, w in bom:
    hBom[h-1] += 1
    wBom[w-1] += 1

# 爆破対象の最大数と最大になる行と列の番号を調べる
maxHBom = max(hBom)
maxWBom = max(wBom)
maxHBomIndex = [index for index, h in enumerate(hBom) if h == maxHBom]
maxWBomIndex = [index for index, w in enumerate(wBom) if w == maxWBom]

# 爆破対象が最大になる行と列の組み合わせについて、
# 爆弾を配置する場所が爆破対象であるかないかで場合分け
for h in maxHBomIndex:
    for w in maxWBomIndex:
        if [h+1, w+1] not in set(bom):
            print(hBom[h] + wBom[w])
            exit()
else:
    print(hBom[h] + wBom[w] - 1)


### FIXED CODE ###

H, W, M = map(int, input().split())
boms = [tuple(map(int, input().split())) for _ in range(M)]
# boms = [list(map(int, input().split())) for _ in range(M)]

hBom = [0]*H
wBom = [0]*W

# 各行、各列の爆破対象をカウント
for h, w in boms:
    hBom[h-1] += 1
    wBom[w-1] += 1

# 爆破対象の最大数と最大になる行と列の番号を調べる
maxHBom = max(hBom)
maxWBom = max(wBom)
maxHBomIndex = [index for index, h in enumerate(hBom) if h == maxHBom]
maxWBomIndex = [index for index, w in enumerate(wBom) if w == maxWBom]

# 爆破対象が最大になる行と列の組み合わせについて、
# 爆弾を配置する場所が爆破対象であるかないかで場合分け
boms = set(boms)
for h in maxHBomIndex:
    for w in maxWBomIndex:
        if (h+1, w+1) not in boms:
            print(maxHBom + maxWBom)
            exit()
else:
    print(maxHBom + maxWBom - 1)
N, K = map(int, input().split())
A = list(map(int, input().split()))
l = A[0]
r = A[K]
for i in range(K-2):
  if l < r:
    print('Yes')
  else:
    print('No')
  l = A[1+i]
  r = A[K+1+i]
if l < r:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
l = A[0]
r = A[K]
for i in range(1,N-K):
  if l < r:
    print('Yes')
  else:
    print('No')
  l = A[i]
  r = A[K+i]
if l < r:
  print('Yes')
else:
  print('No')
N = int(input())
K = int(input())
print(N - K + 1)

### FIXED CODE ###

a,b = map(int,input().split())
print(a - b + 1)
import itertools

N, C = map(int, input().split())
d = [list(map(int, input().split())) for _ in range(C)]
c = [list(map(int, input().split())) for _ in range(N)]

memo = [[0 for i in range(C)]for j in range(3)]

for i in range(N):
    for j in range(N):
        cij = c[i][j]
        a = (i + j + 2) % 3
        for k in range(C):
            memo[a][k] += d[cij-1][k]

ans = 25000000


for c1, c2, c3 in itertools.permutations(range(C), 3):
    ans = min(ans, memo[c1][0] + memo[c2][1] + memo[c3][2])

print(ans)

### FIXED CODE ###

import itertools

N, C = map(int, input().split())
d = [list(map(int, input().split())) for _ in range(C)]
c = [list(map(int, input().split())) for _ in range(N)]

memo = [[0 for i in range(C)]for j in range(3)]

for i in range(N):
    for j in range(N):
        cij = c[i][j]
        a = (i + j + 2) % 3
        for k in range(C):
            memo[a][k] += d[cij-1][k]

ans = float('inf')

for c1, c2, c3 in itertools.permutations(range(C), 3):
    ans = min(ans, memo[0][c1] + memo[1][c2] + memo[2][c3])

print(ans)
l,r,d = map(int,input.split())
print((r-l+1)//d)


### FIXED CODE ###

l,r,d = map(int,input().split())
print(r//d - (l-1)//d)
x=raw_input().split()

for i in reversed(range(len(x)):
print x[::-1],

### FIXED CODE ###

n = int(raw_input())
a = map(int,raw_input().split())
a.reverse()
for i in a:
    print i,
n = ''.join(list(map(int,input().split())))
if int(n)%4 == 0:
  print('YES')
else:
  print('NO')


### FIXED CODE ###

n = ''.join(list(map(str,input().split())))
if int(n)%4 == 0:
  print('YES')
else:
  print('NO')
import math

def main():
    row_input = input()
    A = int(row_input.split()[0])
    B = int(row_input.split()[1])
    #A, B = list(map(int, input().split()))
    result = lcm(A, B)
    print(result)

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

if __name__ == "__main__":
    main()


### FIXED CODE ###

import fractions

def main():
    A, B = list(map(int, input().split()))
    print(lcm(A, B))

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

if __name__ == "__main__":
    main()
N, M = map(int,input().split())
X = list(map(int,input().split()))
li = []
i = j = ans = 0
X.sort()

for i in range(M-1):
  a = abs(int(X[i+1])-int(X[i]))
  li.append(a)
  i += 1
  
li.sort(reverse=True)
del li[0:N-1]

for j in range(N+1):
  if int(len(li)) == 0:
    break
  ans = ans + int(li[j])
  j += 1

print(ans)

### FIXED CODE ###

N,M = map(int,input().split())
X = list(map(int,input().split()))
li = [0]*(M-1)
X.sort()
for i in range(M-1):
    li[i] = abs(X[i+1]-X[i])
li.sort()
print(sum(li[:max(0,M-N)]))
K, X = map(int, input().split())

if (500 * K） < X  :
  print('No') 
else:
  print('Yes') 

### FIXED CODE ###

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

if 500 * K - X >= 0  :
  print('Yes') 
else:
  print('No')
num = split().input()

print num[1] * num[2]

### FIXED CODE ###

num = map(int, raw_input().split())

print num[0] * num[1], 2*num[0] + 2*num[1]
import collections
N=int(input())
l=[input() for i in range(N)]
c=collections.Counter(l)
c=c.most_common()
l2=[]
 
M=c.[0][1]
for i in range(N):
    if c.[i][1]==M:
        l2.append(c.[i][0])
    else:
        break
l2.sort()
for j in range(len(l2)):
    print(l2[j])

### FIXED CODE ###

N=int(input())
dic={}
for i in range(N):
    s=input()
    if s in dic:
        dic[s]+=1
    else:
        dic[s]=0
m=max(dic[i] for i in dic)
ans=[]
for j in dic:
    if dic[j]==m:
        ans.append(j)
ans.sort()
for k in range(len(ans)):
    print(ans[k])
a,b,k=map(int, input().split())
if k>b:
    k=b-1

l1=[i for i in range(a,b+1)] 
l2=[]
for i in range(k):
    l2.append(l1[i])
for i in range(b-a-k+1,b-a+1):
    l2.append(l2[i])

l_set = list(set(l2))
l_set.sort()
for i in range(len(l_set)):
    print(l_set[i])

### FIXED CODE ###

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

ans=list(range(a,min(a+k,b)))+list(range(max(a,b-k+1),b+1))
ans=set(ans)
ans=list(ans)
ans.sort()
for i in range(len(ans)):
    print(ans[i])
import fractions 
A, B, C = [int(k) for k in raw_input().split(' ')]
print((A * B)/ (fractions.gcd(A, B) ** 2 ))



### FIXED CODE ###

import fractions 
A, B, C = [int(k) for k in raw_input().split(' ')]
print(C * ((A * B)/ (fractions.gcd(A, B) ** 2 )))
N = input()
S = N % 10
if(S == 0):
  print("pon")
else if(S == 1):
  print("pon")
else if(S == 6):
  print("pon")
else if(S == 8):
  print("pon")
else if(S == 3):
  print("bon")
else:
  print("hon")

### FIXED CODE ###

N = int(input())
S = N % 10
if(S == 0):
  print("pon")
elif(S == 1):
  print("pon")
elif(S == 6):
  print("pon")
elif(S == 8):
  print("pon")
elif(S == 3):
  print("bon")
else:
  print("hon")
import numpy as np
N=int(input())
list=list(map(int,input().split()))
np_list=np.array(list)
inv_np_list=1/np_list
print(1/(sum(inv_np_list)))

### FIXED CODE ###

a=int(input())
s=input()
print(s if a>= 3200 else 'red')
import copy
n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = True
if n % 2 == 1:
    if a[0] != 0:
        print(0)
    else:
        for i in range(2, n, 2):
            if not(a[i - 1] == i and a[i] == i):
                print(0)
                flag = False
                break
    if flag:
        print(int((2**((n-1)//2))%(1e9+7)))

else:
    for i in range(1, n, 2):
        if not(a[i - 1] == i and a[i] == i):
            print(0)
            flag = False
            break
    if flag:
        print(int((2**(n//2))%(1e9+7)))





### FIXED CODE ###

import copy
n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = True
if n % 2 == 1:
    if a[0] != 0:
        print(0)
    else:
        ans = [i for i in range(2, n, 2) for j in range(2)]
        ans.insert(0, 0)
        if ans != a:
            print(0)
            flag = False
    if flag:
        print((2**((n - 1) // 2)) % (10**9 + 7))

else:
    ans = [i for i in range(1, n, 2) for j in range(2)]
    if ans != a:
        print(0)
        flag = False
    if flag:
        print((2**(n // 2)) % (10**9 + 7))
class Solution(object):
	def __init__(self):
		self.ans = 0
	def search(self, pos, dest):
		if(pos > dest):
			return
		if(pos == dest):
			self.ans += 1
			return
		if(pos - dest % 3 == 0):
			self.ans += (pos // 3) * 2
			return
		self.search(pos+1, dest)
		self.search(pos+2, dest)

N, M = map(int, input().split())
A = []

prev = 0

for i in range(M):
	curr = int(input())
	A.append(curr)
	#prev = curr

A.append(N+1)

#print(A)

ans = 1

prev = 0
for i in range(len(A)):
	s = Solution()
	if(i == 0):
		prev = 0
	else:
		prev = A[i-1] + 1
	#print(prev)
	s.search(prev,A[i]-1)
	con = s.ans
	#print(con)
	ans *= con % 1000000007

print(ans % 1000000007)




### FIXED CODE ###

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

mod = 1000000007

ans = [0] * (N + 1)

ans[0] = 1

for a in A:
	ans[a] = -1

for i in range(len(ans)):
	if ans[i] == -1:
		continue
	if(i+1 < len(ans) and ans[i+1] != -1):
		ans[i+1] += ans[i]
		ans[i+1] %= mod
	if(i+2 < len(ans) and ans[i+2] != -1):
		ans[i+2] += ans[i]
		ans[i+2] %=mod

print(ans[N])
import math

def leave_one_out(array):
  max_gcd = -1
  for i in range(len(array)):
    if i == 0:
      gcd = array[1]
      k = 2
    elif i == 1:
      gcd = array[0]
      k = 2
    else:
      gcd = array[0]
      k = 1
    for j in range(k, len(array)):
      if i == j:
        continue
      gcd = math.gcd(array[j], gcd)
    max_gcd = max(gcd, max_gcd)
  return max_gcd

def main():
  N = int(input().strip())
  A = list(map(int, input().strip().split()))
  print('%d' % leave_one_out(A))

if __name__ == '__main__':
  main()


### FIXED CODE ###

import sys
input = sys.stdin.readline
import math
from fractions import gcd
import operator
from functools import reduce
from itertools import accumulate

def read():
    N = int(input().strip())
    A = list(map(int, input().strip().split()))
    return N, A


def prime_factorization_preprocess(n):
    """
    エラトステネスの篩を用いて、sqrt(n)以下の素数を列挙する
    """
    m = math.floor(math.sqrt(n)) + 1
    primes = []
    is_prime = [True for i in range(m)]
    for i in range(2, m):
        if is_prime[i]:
            primes.append(i)
            for j in range(i+i, m, i):
                is_prime[j] = False
    return primes


def prime_factorization(x, primes):
    """
    試し割り法により、数値の素因数分解を求める
    """
    factors = defaultdict(int)
    for p in primes:
        if x % p == 0:
            n = 0
            while x % p == 0:
                x //= p
                n += 1
            factors[p] = n
    return factors


def solve(N, A, AMAX = 10**9, INF=10**9):
    sl = list(accumulate(A, gcd))
    sr = list(reversed(list(accumulate(reversed(A), gcd))))
    max_gcd = sl[-1]
    for i in range(N):
        # gcdの単位元は0
        v = 0
        if i > 0:
            v = gcd(v, sl[i-1])
        if i < N-1:
            v = gcd(v, sr[i+1])
        max_gcd = max(max_gcd, v)
    return max_gcd


if __name__ == '__main__':
    inputs = read()
    print(solve(*inputs))
n,X,Y = map(int,input().split())

import heapq
def dijkstra_heap(s):
    #始点sから各頂点への最短距離
    d = [float("inf")] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for e in edge[s]:
        heapq.heappush(edgelist,e)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge[1]]:
            continue
        v = minedge[1]
        d[v] = minedge[0]
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,[e[0]+d[v],e[1]])
    return d

E = []
for i in range(n-1):
    E.append([i,i+1,1])
E.append([X-1,Y-1,1])

edge = [[] for i in range(n)]
#edge[i] : iから出る道の[重み,行先]の配列
for i in range(w):
    for e in E:
        x,y,z = map(int,e)
        edge[x].append([z,y])
        edge[y].append([z,x])

for i in range(1,n):
    cnt = 0
    for j in range(n):
        tmp = dijkstra_heap(j)
        for t in tmp[j:]:
            if t==i:
                cnt += 1
    print(cnt)

### FIXED CODE ###

N, X, Y = map(int, input().split())
ans = [0]*(N-1)
for i in range(1, N):
    for j in range(i+1, N+1):
        d = min(j-i, abs(X-i)+abs(j-Y)+1)
        ans[d-1] += 1

print(*ans, sep='\n')
N = int(input())
a = list(map(int,input().rstrip().split(" ")))
counter = [0,0,0]
for i in a:
    if i % 4 == 0:
        counter[2] += 1
    elif i % 2 == 0:
        counter[1] += 1
    else:
        counter[0] += 1

if counter[1] == 1:
    counter[1] = 0
    counter[0] += 1
    if(counter[2] != 0):
        p += 1
p = (max(counter[1] - 1,0)) + counter[2] * 2

if p >= counter[0]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = int(input())
a = list(map(int,input().rstrip().split(" ")))
counter = [0,0,0]
for i in a:
    if i % 4 == 0:
        counter[2] += 1
    elif i % 2 == 0:
        counter[1] += 1
    else:
        counter[0] += 1
counter[0] += min(1,counter[1])

if counter[2] + 1 >= counter[0]:
    print("Yes")
else:
    print("No")
N, X = list(map(int, input().split()))

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


now = 0
i = 0
ans = 0
while True:
    if now > X:
        break
    now += L[i]
    i += 1
    ans += 1

print(ans)

### FIXED CODE ###

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

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

count = 0
now = 0
for i in L:
    if now > X:
        break
    now += i
    count += 1
if now <= X:
    count += 1
print(count)
class Union_Find:
    def __init__(self, n):
        self.root = [-1]*n
    
    def find(self, x):
        if self.root[x] < -1:
            return x
        else:
            self.root[x] = self.find(self.root[x])
            return root[x]

    def unite(self, x, y):
        x = find(x)
        y = find(y)
        if x == y:
            return
        else:
            self.root[x] += self.root[y]
            self.root[y] = x

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


n, m = map(int, input().split())
uf = Union_Find(n)

for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    uf.unite(a, b)

ans = 0
for i in range(n):
    size = uf.root[i]*(-1)
    ans = max(ans, size)

print(ans)

### FIXED CODE ###

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

root = [-1]*n
def r(x):
    if root[x] < 0:
        return x
    else:
        root[x] = r(root[x])
        return root[x]

def unite(x, y):
    x = r(x)
    y = r(y)
    if x == y:
        return
    root[x] += root[y]
    root[y] = x

for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    unite(a, b)

ans = 0
for i in range(n):
    ans = max(ans, -root[i])

print(ans)
n=int(input())
a=[int(i) for i in input().split()]
for i in range(n):
    ans=0
    for j in a:
        if j!=a[i]:
            ans^=j
    aa.append(a)
print("".join(aa))

### FIXED CODE ###

n=int(input())
a=[int(i) for i in input().split()]
aa=[]
ans=0
for i in a:
    ans^=i
anss=int(ans)
for i in range(n):
    anss^=a[i]
    aa.append(anss)
    anss=int(ans)
print(" ".join(map(str,aa)))