Harryxun/stf_run huggingface dataset:
#%%
import numpy as np
n,nige,oni = map(int,input().split())
aa = np.zeros((n,n),dtype=bool)
for i in range(n-1):
    a,b = map(int,input().split())
    aa[a-1][b-1] = 1
    aa[b-1][a-1] = 1
nigel = np.zeros(n)
nigel[nige-1] = 1
onil = np.zeros(n)
onil[oni-1] = 1
ans = 0
for i in range(n-1):
    nigel = np.any(aa[nigel] == True,axis = 0)
    if np.logical_and(onil,nigel) == nigel:
        print(ans)
        return
    ans += 1
    onil = np.any(aa[onil] == True,axis = 0)
    if np.logical_and(onil,nigel) == nigel:
        print(ans)
        return



### FIXED CODE ###

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,u,v = mi()
data = [[] for _ in range(n)]
for i in range(n-1):
    a,b = mi()
    a -= 1
    b -= 1
    data[a].append(b)
    data[b].append(a)
inf = -1
oni = [inf]*n
ko = [inf]*n

from collections import deque

def start(hazime,alis):
    d = deque()
    d.append((hazime-1,0))
    alis[hazime-1] = 0
    while d:
        ima,num = d.popleft()
        num += 1
        for i in data[ima]:
            if alis[i] != inf:
                continue
            alis[i] = num 
            d.append((i,num))
start(u,ko)
start(v,oni)

if len(data[u]) == 1 and data[u] == v:
    print(0) 
    exit()
ans = -1
for i in range(n):
    if ko[i] <= oni[i]:
        ans = max(ans,oni[i]-1)
print(ans)
li = list(map(int, input().split()))
li.sort(reverse = True)
i = 0
while i <= len(li): 
    a = li[i]
    i += 2
i = 1
while i <= len(li):
    b = li[i]
    i += 2
print(a -b)

### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
l.sort(reverse = True)
i = 0
a = 0
b = 0
while i < n: 
    a = a +l[i]
    i += 2
i = 1
while i < n:
    b = b +l[i]
    i += 2
print(a -b)
List=list(input().split())
for n in List:
  print(n[0].Upper(),end="")

### FIXED CODE ###

List=list(input().upper().split())
for s in List:
  print(s[0],end="")
N = int(input())
A=list(map(int, input().split()))

def sol(i,want):
    num=int(N/(i+1))
    wa=-A[0]
    for j in range(num):
        wa+=A[i+j*i]
    wa=wa%2
    if wa==want:
        x=0
    else:
        x=1
#     print(num)
    return x 

B=A[:]
half=int(N/2)
for i in range(half):
    j=half-1-i
#     print(j)
    B[j]=sol(j,A[j])
    
C=[]
for i in range(N):
    if B[i]==1:
        C.append(i+1)
m=sum(B)
print(m)
print(*C)

### FIXED CODE ###

r = int(input())
print(3*r**2)
# ANSHUL GAUTAM
# IIIT-D

from math import *

'''

'''

a,b = list(map(int, input().split()))
print(0)


### FIXED CODE ###

# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from sys import stdin
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''

'''

def solve(l):
	n = len(l)
	

N = int(stdin.readline())
s,t = list(map(str, stdin.readline().rstrip().split()))
ans = ''
for i in range(N):
	ans += s[i] + t[i]
print(ans)
import sys

s = input()
k = int(input())
cnt  = 0
ans  = 0
while True:
    if cnt == len(s):
        print("1")
        sys.exit(1)
    if s[cnt] != '1':
        print(s[cnt])
        sys.exit(1)
    cnt += 1

### FIXED CODE ###

s = input()
k = int(input())
ans  = True
for i in range(k):
    if s[i] != '1':
        print(s[i])
        ans = False
        break
if ans:
    print(1)
import math
import numpy as np
from itertools import accumulate, chain, islice, starmap
N = int(input())
numbers = list(map(int, input().split()))
# numbers = [2, 4, 8, 8]
# N = len(numbers)


def calculate_maximum_subgcd_with_np_ufunc(numbers):
    gcd = np.frompyfunc(math.gcd, 2, 1)
    cumgcds = gcd.accumulate(numbers, dtype=np.object).astype(np.int)
    sub_cumgcds = np.roll(cumgcds, 1)
    sub_cumgcds[0] = 0
    reverse_cumgcds = gcd.accumulate(
        numbers[::-1], dtype=np.object).astype(np.int)
    sub_reverse_cumgcds = np.roll(reverse_cumgcds, 1)
    sub_reverse_cumgcds[0] = 0
    return np.max(gcd(sub_cumgcds, sub_reverse_cumgcds[::-1]))


def calculate_maximum_subgcd_with_func(numbers):
    operation = math.gcd
    cumgcds = accumulate(numbers, operation)
    sub_cumgcds = islice(chain([0], cumgcds), len(numbers))
    reverse_cumgcds = accumulate(numbers[::-1], operation)
    sub_reverse_cumgcds = islice(chain([0], reverse_cumgcds), len(numbers))
    sub_gcds = starmap(operation, zip(sub_cumgcds, list(sub_reverse_cumgcds)[::-1]))
    return max(sub_gcds)


# calculate_maximum_subgcd = calculate_maximum_subgcd_with_np_ufunc
calculate_maximum_subgcd = calculate_maximum_subgcd_with_func

print(calculate_maximum_subgcd(numbers))


### FIXED CODE ###

# import math
import fractions
import numpy as np
from itertools import accumulate, chain, islice, starmap
N = int(input())
numbers = list(map(int, input().split()))
# numbers = [2, 4, 8, 8]
# N = len(numbers)


def calculate_maximum_subgcd_with_np_ufunc(numbers):
    gcd = np.frompyfunc(fractions.gcd, 2, 1)
    cumgcds = gcd.accumulate(numbers, dtype=np.object).astype(np.int)
    sub_cumgcds = np.roll(cumgcds, 1)
    sub_cumgcds[0] = 0
    reverse_cumgcds = gcd.accumulate(
        numbers[::-1], dtype=np.object).astype(np.int)
    sub_reverse_cumgcds = np.roll(reverse_cumgcds, 1)
    sub_reverse_cumgcds[0] = 0
    return np.max(gcd(sub_cumgcds, sub_reverse_cumgcds[::-1]))


def calculate_maximum_subgcd_with_func(numbers):
    operation = fractions.gcd
    cumgcds = accumulate(numbers, operation)
    sub_cumgcds = islice(chain([0], cumgcds), len(numbers))
    reverse_cumgcds = accumulate(numbers[::-1], operation)
    sub_reverse_cumgcds = islice(chain([0], reverse_cumgcds), len(numbers))
    sub_gcds = starmap(operation, zip(sub_cumgcds, list(sub_reverse_cumgcds)[::-1]))
    return max(sub_gcds)


# calculate_maximum_subgcd = calculate_maximum_subgcd_with_np_ufunc
calculate_maximum_subgcd = calculate_maximum_subgcd_with_func

print(calculate_maximum_subgcd(numbers))
n = int(input())
L = list(map(int,input().split()))
dp = [0]*(2*(10**5)+1000)
for i in range(n):
    dp[L[i]] +=1

one = []
for i in range(len(dp)):
    if dp[i] == 1:
        one.append(i)

dp = [0]*(2*(10**5)+1000)
a = list(set(L))
for i in L:
    for j in range(2*i,(2*(10**5)+1000),i):
        if not dp[j-1]:
            dp[j-1] = 1

ans = 0
for i in one:
    if dp[i-1] == 0:
        ans +=1
print(ans)

### FIXED CODE ###

n = int(input())
L = list(map(int,input().split()))
dp = [0]*((10**6)+1000)
for i in L:
    dp[i] +=1

one = []
for i in range(10**6+1000):
    if dp[i] == 1:
        one.append(i)

dp = [0]*((10**6)+1000)
a = list(set(L))
for i in a:
    for j in range(2*i,10**6+1000,i):
        dp[j] = 1

ans = 0
for i in one:
    if dp[i] == 0:
        ans +=1
print(ans)
N, K = map(int, input().split())
D = input().split()
ans = N
for i in range(N, 10000):
    for x in str(ans):
        if x in D:
            ans += 1
            break;
    if ans == i:
        print(ans)
        break

### FIXED CODE ###

l = list(map(int, input().split()))
if (l.count(5) == 2) and (l.count(7) == 1):
    print('YES')
else:
    print('NO')
import sys
import heapq 
input = sys.stdin.readline
n,m = map(int,input().split())
alwork = [() for i in range(m+1)]
w = []
hpop = heapq.heappop
hpush = heapq.heappush
ans = 0

for i in range(n):
  a,b = map(int,input().split())
  alwork[a] += (-b,)

for i in range(1,m+1):
  for j in alwork[i]:
    hpush(w,j)
  if w:
    ans += hpop(w)
print(-ans)

### FIXED CODE ###

import sys
import heapq 
input = sys.stdin.readline
n,m = map(int,input().split())
l=[tuple(map(int,input().split())) for i in range(n)]
l.sort(reverse=True)

w = []
hpop = heapq.heappop
hpush = heapq.heappush
ans = 0

for i in range(1,m+1):
  while l and l[-1][0]==i:
    hpush(w,-l.pop()[1])
  if w:
    ans += hpop(w)
print(-ans)
from collections import Counter

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

count = Counter(Alist)
res = 1
if N % 2 ==0:
    for i in range(1,N,2):
        if count[i] != 2:
            print(0)
            exit()
else:
    if count[0] != 1:
        print(0)
        exit()
    else:
        for i in range(2,N,2):
            if count[i] != 2
                print(0)
                exit()
print(2**(N//2) % (10**9+7))

### FIXED CODE ###

from collections import Counter

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

count = Counter(Alist)
res = 1
if N % 2 ==0:
    for i in range(1,N,2):
        if count[i] != 2:
            print(0)
            exit()
else:
    if count[0] != 1:
        print(0)
        exit()
    else:
        for i in range(2,N,2):
            if count[i] != 2:
                print(0)
                exit()
print(2**(N//2) % (10**9+7))
A = ['Sunny','Cloudy',''Rainy']
S = int(input())
print(A[S%3])

### FIXED CODE ###

A = ['Sunny','Cloudy','Rainy']
S = input()
for i in range(3):
  if A[i] == S:
    ans = A[(i+1)%3]
print(ans)
A,B = map(int,input().split())
cnt = 0
for i in range(1,B+1):
    if  B == 1:
        cnt = 1
        a = 0
        break
    elif count == 0 and A >= B:
        cnt = 1
        a = 1
        break
    elif (A-1)*(i-1)+A >=B:
        a = i
        break
print(a)

### FIXED CODE ###

A, B = map(int, input().split())
cnt = 1
while A*cnt-(cnt-1) < B:
  cnt +=1
print(cnt if B > 1 else 0)
from functools import lru_cache

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

hit = [False] * N


@lru_cache(maxsize=None)
def ac_count(start, end):
    if start == end:
        return 0

    end_count = 1 if hit[end - 1] else 0

    return ac_count(start, end - 1) + end_count


for i in range(0, N):
    if S[i:i+2] == 'AC':
        hit[i] = True

for _ in range(0, Q):
    l, r = map(int, input().split())
    print(ac_count(l - 1, r - 1))


### FIXED CODE ###

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

hit = [0] * N

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

    if S[i:i+2] == 'AC':
        hit[i + 1] += 1

for _ in range(0, Q):
    l, r = map(int, input().split())
    result = hit[r - 1] - hit[l - 1]
    print(result)
N=int(input())

def num_6(A):
	i=0
	while True:
		if 6**i>A:
			return i-1
		i=i+1

def num_9(A):
	i=0
	while True:
		if 9**i>A:
			return i-1
		i=i+1

num_arr=[]
for i in range(N-1):
	num_6_max=num_6(i+1)
	num_9_max=num_9(N-(i+1))
	a6_num=[]
	a9_num=[]
	A=i+1
	B=N-(i+1)
	for j in range(num_6_max+1):
		a6_num.append(A//(6**(num_6_max-j)))
		A=A-(6**(num_6_max-j))*a6_num[j]
	for j in range(num_9_max+1):
		a9_num.append(B//(9**(num_9_max-j)))
		B=B-(9**(num_9_max-j))*a9_num[j]
	num_arr.append(sum(a6_num)+sum(a9_num))
print(min(num_arr))


### FIXED CODE ###

N=int(input())

def num_6(A):
	i=0
	while True:
		if 6**i>A:
			return i-1
		i=i+1

def num_9(A):
	i=0
	while True:
		if 9**i>A:
			return i-1
		i=i+1

num_arr=[]
for i in range(N+1):
	num_6_max=num_6(i)
	num_9_max=num_9(N-i)
	a6_num=[]
	a9_num=[]
	A=i
	B=N-(i)
	for j in range(num_6_max+1):
		a6_num.append(A//(6**(num_6_max-j)))
		A=A-(6**(num_6_max-j))*a6_num[j]
	for j in range(num_9_max+1):
		a9_num.append(B//(9**(num_9_max-j)))
		B=B-(9**(num_9_max-j))*a9_num[j]
	num_arr.append(sum(a6_num)+sum(a9_num))
print(min(num_arr))
n=int(input())
def gauss_2(n):
    g=0
    while g<=n**(1/2):
        g+=1
    return g-1

def gauss_3(n):
    g=0
    while g<=n**(1/3):
        g+=1
    return g-1
def gauss_4(n):
    g=0
    while g<=n**(1/4):
        g+=1
    return g-1
def gauss_5(n):
    g=0
    while g<=n**(1/5):
        g+=1
    return g-1
def gauss_6(n):
    g=0
    while g<=n**(1/6):
        g+=1
    return g-1
def gauss_7(n):
    g=0
    while g<=n**(1/7):
        g+=1
    return g-1

if n<=3:
    print(1)
elif n not in (125,216,343,512,729):
    print(max(gauss_2(n)**2,gauss_3(n)**3,gauss_4(n)**4,gauss_5(n)**5,gauss_6(n)**6,gauss_7(n)**7))
else:
    print(n)

### FIXED CODE ###

#097a
a,b,c,d=map(int,input().split())
if -d<=a-c<=d:
    print("Yes")
elif -d<=a-b<=d and -d<=b-c<=d:
    print("Yes")
else:
    print("No")
import math
from collections import deque
def main():
    n,p = tuple([int(t)for t in input().split()])
 
    s = input()[::-1]
    subs = [0]*p
    counter =0
    for i in range(0,n):
        subs[int(s[0:i+1])%p] +=1
 
    counter+=subs[0]
 
    for i in range(p//2):
        counter+= subs[i]*subs[-i-1]
 
 
    counter+=subs[0]*(subs[0]-1)//2
 
    print(counter)
 
if __name__ == "__main__":
    main()

### FIXED CODE ###

import math
from collections import deque
def main():
    s = set(input())

    print("Yes" if len(s) == 2 else "No")



if __name__ == "__main__":
    main()
S=input()
S=S[:len(S)-1]
s=list(S)
x,y=map(int,input().split())
fora=0
side=[]
updw=[]
while s[0]=="F":
  fora+=1
  s.pop(0)
  if len(s)==0: break
flag=1#1のとき横向き、-1のときたて向き
step=0
while s:
  if s[0]=="T":
    s.pop(0)
    if flag==-1: updw+=[step]
    else: side+=[step]
    flag=flag*(-1)
    step=0
  else:
    s.pop(0)
    step+=1
    if len(s)==0:
      if flag==-1: updw+=[step]
      else: side+=[step]
ypossi=len(side)
tpossi=len(updw)
X=sum(side)+fora+x
Y=sum(updw)+y
xdp=[[0 for i in range(2*X+1)] for j in range(ypossi+1)]
#dp[i][j] i個文字使ったときにj+len(s)は達成できるか
xdp[0][fora+X]=1 
for i in range(ypossi):
  for j in range(2*X+1):
    if j-side[i]>=0:
      if xdp[i][j-side[i]]==1:xdp[i+1][j]=1
    if j+side[i]<2*X+1:
      if xdp[i][j+side[i]]==1:xdp[i+1][j]=1
        
ydp=[[0 for i in range(2*Y+1)] for j in range(tpossi+1)]
#dp[i][j] i個文字使ったときにj+len(s)は達成できるか
ydp[0][Y]=1 
for i in range(tpossi):
  for j in range(2*Y+1):
    if j-updw[i]>=0:
      if ydp[i][j-updw[i]]==1:ydp[i+1][j]=1
    if j+updw[i]<2*Y+1:
      if ydp[i][j+updw[i]]==1:ydp[i+1][j]=1
if xdp[ypossi][x+X]==1 and ydp[tpossi][y+Y]==1:
  print("Yes")
else: print("No")

### FIXED CODE ###

S=str(input())
s=list(S)
x,y=map(int,input().split())
fora=0
side=[]
updw=[]
while s[0]=="F":
  fora+=1
  s.pop(0)
  if len(s)==0:break
flag=1#1のとき横向き、-1のときたて向き
step=0
while s:
  if s[0]=="T":
    s.pop(0)
    if step:
      if flag==-1: updw+=[step]
      else: side+=[step]
    flag=flag*(-1)
    step=0
  elif s[0]=="F":
    s.pop(0)
    step+=1
    if len(s)==0:
      if flag==-1: updw+=[step]
      else: side+=[step]
  else: break
ypossi=len(side)
tpossi=len(updw)
X=sum(side)+fora+abs(x)
Y=sum(updw)+abs(y)
xdp=[[0 for i in range(2*X+1)] for j in range(ypossi+1)]
#dp[i][j] i個文字使ったときにj+len(s)は達成できるか
xdp[0][fora+X]=1 
for i in range(ypossi):
  for j in range(2*X+1):
    if j-side[i]>=0:
      if xdp[i][j-side[i]]==1:xdp[i+1][j]=1
    if j+side[i]<2*X+1:
      if xdp[i][j+side[i]]==1:xdp[i+1][j]=1

ydp=[[0 for i in range(2*Y+1)] for j in range(tpossi+1)]
#dp[i][j] i個文字使ったときにj+len(s)は達成できるか
ydp[0][Y]=1 
for i in range(tpossi):
  for j in range(2*Y+1):
    if j-updw[i]>=0:
      if ydp[i][j-updw[i]]==1:ydp[i+1][j]=1
    if j+updw[i]<2*Y+1:
      if ydp[i][j+updw[i]]==1:ydp[i+1][j]=1
if xdp[ypossi][x+X]==1 and ydp[tpossi][y+Y]==1:
  print("Yes")
else: print("No")
N,M = input().strip().split()
N,M = [int(N),int(M)]
array = list(map(int, input().strip().split()))

sum = [array[0]]

i = 1

while i < len(array):
	sum[i] = sum[i-1] + a[i]
  
j = 0

count = 0

while sum[j] <= M:
  	count =+ 1
    j =+ 1
    
print(count)
  	

### FIXED CODE ###

n,x = list(map(int,input().split()))
l = list(map(int,input().split()))

d = 0
count = 0

for i in range(len(l)):
  if d <= x:
  	d = d + l[i]
  	count = count + 1
  
if d <= x:
  count += 1
  
print(count)
import math

n = int(input())

ans  = 10 ** 7 
for i in range(1, math.sqrt(n) + 1):
    if n%i != 0:
        continue
    j = n/i
    ans = min(ans, i+j-2)

print(ans)

### FIXED CODE ###

import math

n = int(input())

ans  = 10 ** 12 
for i in range(1, math.floor(math.sqrt(n)) + 1):
    if n%i != 0:
        continue
    j = int(n/i)
    ans = min(ans, i+j-2)

print(ans)
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
b = []
for i in range(N):
	b.append(int(input()))
	
yoko = A
tate = [[], [], []]
for row in A:
	for i in range(3):
		tate[i].append(row[i])
naname = [[A[0][0], A[1][1], A[2][2]], [A[0][3], A[1][1], A[2][0]]]

all = yoko + tate + naname

y = 0
chk = 0
for kumi in all:
	for k in kumi:
		if k in b:
			chk += 1
		else:
			continue
	if chk == 3:
		print("Yes")
		y = 1
		break
	else:
		chk = 0
		
if y == 0:
	print("No")

### FIXED CODE ###

A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
b = []
for i in range(N):
	b.append(int(input()))
	
yoko = A
tate = [[], [], []]
for row in A:
	for i in range(3):
		tate[i].append(row[i])
naname = [[A[0][0], A[1][1], A[2][2]], [A[0][2], A[1][1], A[2][0]]]

all = yoko + tate + naname

y = 0
chk = 0
for kumi in all:
	for k in kumi:
		if k in b:
			chk += 1
		else:
			continue
	if chk == 3:
		print("Yes")
		y = 1
		break
	else:
		chk = 0
		
if y == 0:
	print("No")
def main():
    number = []
    for i in range(10):
        num = int(input())
        number.append(num)


    numbers = number.sorted(number)
    print(numbers[9])
    print(numbers[8])
    print(numbers[7])




if __name__=='__main__':
    main()

### FIXED CODE ###


array = []
for i in range(10):
    num = int(input())
    array.append(num)

list = sorted(array)
print(list[9])
print(list[8])
print(list[7])
import pandas

### FIXED CODE ###

param_n, param_d = map(int, input().split())

param_count = 0
for i in range(param_n):
    param_a, param_b = map(int, input().split())
    
    if (param_a)*(param_a) + (param_b)*(param_b) <= (param_d)*(param_d):
        param_count = param_count + 1
        
print(param_count)
k,t=map(int,input().split())
l=[int(i) for i in input().split()]
x=[int(i) for i in l]
nin=min(x)
nen=t

while 1:
    w=[]
    for i in x:
        if i-nin!=0:
            w.append(i-nin)
    x=[i for i in w]
    nin=min(x)
    if len(x)<=1:
        print(x[0]-nin)
        exit()
    nen=len(x)

### FIXED CODE ###

k,t=map(int,input().split())
l=[int(i) for i in input().split()]
if t==1:
    print(l[0]-1)
    exit()
while 1:
    l.sort(reverse=True)
    if l[1]==0: break
    l[0]-=l[1]
    l[1]=0

print(max(0,l[0]-1))
N,M,C=map(int, input().split())
B=list(map(int(input().split())))
cnt=0

for i in range(N):
  A=list(map(int, input().split()))
  p=C
  for j in range(M):
    p+=A[j]*B[J]
    if p>0:
      cnt+=1
print(cnt)


### FIXED CODE ###

N,M,C=map(int,input().split())
B=list(map(int,input().split()))
count=0
for i in range(N):
    A=list(map(int,input().split()))
    p=C
    for j in range(M):p+=A[j]*B[j]
    if p>0:count+=1
print(count)
import operator as op
from io import StringIO
from collections import *
from functools import *
from math import gcd
import sys


def main(inputs):
    # n = int(next(inputs))
    # xs = list(map(int, next(inputs).split()))
    xs = list(map(int, next(inputs).split()))
    y = reduce(gcd, xs)
    r, g, b, n = map(op.floordiv, xs, [y]*4)
    ans = 0
    for i in range(1 + (n // r)):
        n_r = n - r*i
        for j in range(1 + (n_r // g)):
            if (n_r - g*j) % b == 0:
                #print("{}".format((i, j)))
                ans += 1
                pass
            pass
        pass
    return ans


def gen_inputs(str_=None):
    inputs = StringIO(str_) if str_ else sys.stdin
    while True:
        a = inputs.readline().rstrip()
        yield a
        pass
    pass


if __name__ == "__main__":
    print(main(gen_inputs()))
    pass


### FIXED CODE ###

import operator as op
from io import StringIO
from collections import *
from functools import *
from fractions import gcd
import sys


def main(inputs):
    # n = int(next(inputs))
    # xs = list(map(int, next(inputs).split()))
    xs = list(map(int, next(inputs).split()))
    y = reduce(gcd, xs)
    r, g, b, n = map(op.floordiv, xs, [y]*4)
    ans = 0
    for i in range(1 + (n // r)):
        n_r = n - r*i
        for j in range(1 + (n_r // g)):
            if (n_r - g*j) % b == 0:
                #print("{}".format((i, j)))
                ans += 1
                pass
            pass
        pass
    return ans


def gen_inputs(str_=None):
    inputs = StringIO(str_) if str_ else sys.stdin
    while True:
        a = inputs.readline().rstrip()
        yield a
        pass
    pass


if __name__ == "__main__":
    print(main(gen_inputs()))
    pass
a=int(input())
b=int(input())
c=int(input())
x=int(input())

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      num_500=500*i
      num_100=100*j
      num_50=50*k
      if num_500+num_100+num_50==x:
        ans+=1
        
print(ans)


### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
x=int(input())

ans=0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      num_500=500*i
      num_100=100*j
      num_50=50*k
      if num_500+num_100+num_50==x:
        ans+=1
        
print(ans)
n, a, b, c = list(map(int, input().split()))
s = [list(input()) for _ in range(n)]
d = {"A": a, "B": b, "C": c}
ans = []
for i, [j, k] in enumerate(s):
    if d[j] == 0 and d[k] == 0:
        print("No")
        break
    elif d[j] > d[k]:
        calc(k, j)
    elif d[j] < d[k]:
        calc(j, k)
    elif i + 1 != n:
        if j == "A":
            if s[i + 1][1] == "C":
                calc(k, j)
            else:
                calc(j, k)        
        else:
            if s[i + 1] == ["A", "C"]:
                calc(k, j)
            else:
                calc(j, k)
    else:
        calc(j, k)
else:
    print("Yes")
    for i in ans:
        print(i)   

### FIXED CODE ###

n, a, b, c = list(map(int, input().split()))
s = [list(input()) for _ in range(n)]
s.append(["A", "B"])
d = {"A": a, "B": b, "C": c}
ans = []

def calc(add, sub):
    d[add] += 1
    d[sub] -= 1
    ans.append(add)

for i, [j, k] in enumerate(s):
    if i == n:
        print('Yes')
        print('\n'.join(ans))
        break
    if d[j] == 0 and d[k] == 0:
        print("No")
        break
    elif j == "A" and k == "B":
        
        if d[j] < d[k]:
            calc(j, k)
        elif d[j] > d[k]:
            calc(k, j)
        else:
            if s[i + 1][0] == "A":
                calc(j, k)
            else:
                calc(k, j)
    elif j == "A" and k == "C":

        if d[j] < d[k]:
            calc(j, k)
        elif d[j] > d[k]:
            calc(k, j)
        else:
            if s[i + 1][0] == "A":
                calc(j, k)
            else:
                calc(k, j)
    elif j == "B" and k == "C":

        if d[j] < d[k]:
            calc(j, k)
        elif d[j] > d[k]:
            calc(k, j)
        else:
            if s[i + 1][0] == "A" and s[i + 1][1] == "C":
                calc(k, j)
            else:
                calc(j, k)
N,M = map(int,input().split())
A = list(map(int,input().split()))
BC = [list(map(int,input().split())) for i in range(M)]
A.sort(key=lambda x:-x)
BC.sort(key=lambda x:x[1])
B = []
while BC:
    b,c = BC.pop()
    while c > 0:
        B.append(b)
        c -= 1
        if len(B) == N:
            break

ans = 0
while B:
    a = A.pop()
    b = B.pop()
    ans += max(a,b)
ans += sum(A)
print(ans)

### FIXED CODE ###

N,M = map(int,input().split())
A = list(map(int,input().split()))
BC = [list(map(int,input().split())) for i in range(M)]
A.sort(key=lambda x:-x)
BC.sort(key=lambda x:x[1])
C = []
while BC and len(C) < N:
    b,c = BC.pop()
    for i in range(b):
        C.append(c)
        if len(C) == N:
            break
C.sort()
ans = 0
while C:
    a = A.pop()
    c = C.pop()
    ans += max(a,c)
ans += sum(A)
print(ans)
a=[0]*1000000001
N = int(input())
for i in range(N):
    a[int(input().strip())]+=1
for i in range(len(a)):
    a[i]=a[i]%2
print(sum(a))

### FIXED CODE ###

d={}
N = int(input())
    
for i in range(N):
    b=int(input().strip())
    if b in d:
        d.pop(b)
    else:
        d[b]=-1
print(len(d))