Harryxun/stf_run huggingface dataset:
from collections import defaultdict
n, q = map(int, input().split())
child = defaultdict(list)
ns = set()
for i in range(n - 1):
    a, b = map(int, input().split())
    child[a].append(b)
    ns.add(a)
    ns.add(b)
cnt = defaultdict(int)
for i in range(q):
    p, x = map(int, input().split())
    cnt[p] += x
def dfs(i):
    for num in child[i]:
        cnt[num] += cnt[i]
        dfs(num)
dfs(1)
print(' '.join(str(value) for _, value in sorted(cnt.items(), key=lambda x: x[0])))


### FIXED CODE ###

n, q = map(int, input().split())
connect = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    connect[a - 1].append(b-1)
    connect[b - 1].append(a - 1)
    
values = [0] * n
for _ in range(q):
    p, x = map(int, input().split())
    values[p - 1] += x

from collections import deque
que = deque([[-1, 0]])
while que:
    parent, child = que.popleft()
    for num in connect[child]:
        if num == parent:
            continue
        values[num] += values[child]
        que.append([child, num])
print(*values)
S = str(input())

count = 0
result = []

for i in range(len(S)):
  if (S[i] == "A") or (S[i] == "C") or (S[i] == "G") or (S[i] == "T"):
    count += 1
  else:
    result.append(count)
    count = 0

maxi = result[0]
    
for j in range(len(result)):
  if maxi < result[j]:
    maxi = result[j]

print(maxi)


### FIXED CODE ###

S = str(input())

count = 0
result = []

for i in range(len(S)):
  if (S[i] == "A") or (S[i] == "C") or (S[i] == "G") or (S[i] == "T"):
    count += 1
    if i == len(S) - 1:
      result.append(count)
  else:
    result.append(count)
    count = 0
    if i == len(S) - 1:
      result.append(count)

maxi = result[0]
    
for j in range(len(result)):
  if maxi < result[j]:
    maxi = result[j]

print(maxi)
H,K=map(int,input().split())

ln=list(map(int,input().split()))
 
sum=0

ln.sort(reverse=True)
for A in range(K):
	ln[A]=0
 
for A in ln:
  sum+=A
 
print(sum)

### FIXED CODE ###

H,K=map(int,input().split())
 
s=list(map(int,input().split()))
 
sum=0

s.sort(reverse=True)

if K>=len(s):
  for A in range(len(s)):
    s[A]=0

else:
  for A in range(K):
    s[A]=0



for A in s:
  sum+=A
 
print(sum)
N = int(i)
inp = [int(i) for i in raw_input().split()]

sorted_inp = sorted(inp)

diff = 0

for i in range(len(inp)):
  if inp[i] != sorted_inp[i]:
    diff += 1

if diff ==  or diff==2:
  print "YES"
else:
  print "NO"

### FIXED CODE ###

N = int(raw_input())
inp = [int(i) for i in raw_input().split()]

sorted_inp = sorted(inp)

diff = 0

for i in range(len(inp)):
  if inp[i] != sorted_inp[i]:
    diff += 1

if diff == 0 or diff==2:
  print "YES"
else:
  print "NO"
L,N=(int(i) for i in input().split())
X = []
for i in range(0,N):
    a = int(input())
    X.append(a)
import math
if X[math.ceil(N/2)]<L/2:
  result=X[N-1]
  i=0
  j=N-1
  while i<= math.floor(N/2)-1 and j<=math.ceil(N/2)-1:
      result+=abs(X[j]-X[i])
      j-=1
      i+=1
else:
  while i<= math.floor(N/2)-1 and j<=math.ceil(N/2)-1:
      result+=abs(X[i]-X[j])
      j-=1
      i+=1
print(result)

### FIXED CODE ###

a,b,c=(int(i) for i in input().split())
if b+1>=c:
  print(b+c)
else:
  if a+1>=c-b:
    print(b+c)
  else:
    print(2*b+a+1)
inputStr = input()

if inputStr == 'ABC':
  print('ARC')
else if inputStr == 'ARC':
  print('ABC')
else:
  print('')

### FIXED CODE ###

inputStr = input()

if inputStr == 'ABC':
 	print('ARC')
else:
	print('ABC')
N = int(input())
print(N*(N-1)//2-(3*(N//3)*(N//3-1)+5*(N//5)*(N//5-python
                                              p1))//2+15*(N//15)*(N//15-1)//2)


### FIXED CODE ###

print("Yes" if("7"in input())else"No")
H, W = map(int, input().split())
for h in range(0, H+1):
  for w in range(0, W+1):
    if h*W + w*H - h*w == K:
      print('Yes')
      exit()
print('No')

### FIXED CODE ###

H, W, K = map(int, input().split())
for h in range(0, H+1):
  for w in range(0, W+1):
    if h*W + w*H - 2*h*w == K:
      print('Yes')
      exit()
print('No')
n,m=map(int,input().split())
lists=list(map(int,input().split()))
checklist=[]
count=0

for i in range(m):
    b,c=map(int,input().split())
    checklist.append((c,b))
checklist=sorted(checklist,reverse=True)
lists=sorted(lists)
uselist=[]
count=0

for i in checklist:
    for _ in range(i[1]):
        uselist.append(i[0])
    count+=i[1]

    if count>=n:
        break
answer=0
for i in range(n):
    if lists[i]<uselist[i]:
            lists[i]=uselist[i]
    else:
        break
print(sum(lists))

### FIXED CODE ###

n,m=map(int,input().split())
lists=list(map(int,input().split()))
checklist=[]
count=0

for i in range(m):
    b,c=map(int,input().split())
    checklist.append((c,b))
checklist=sorted(checklist,reverse=True)
lists=sorted(lists)
uselist=[]
count=0

for i in checklist:
    for _ in range(i[1]):
        uselist.append(i[0])
    count+=i[1]

    if count>=n:
        break
answer=0
n=min(n,len(uselist))
for i in range(n):
    if lists[i]<uselist[i]:
            lists[i]=uselist[i]
    else:
        break
print(sum(lists))
import numpy as np
n = int(input()) 
#n=4
lst = [int(input()) for i in range(n)]
#lst = [2, 10, 8, 40]
#lst = [5, 13, 8, 1000000000]
hps = np.array(lst)
while(1):
    hps = sorted(hps)
    print(hps)
    if(hps[0]==0): break
    if(hps[0]==hps[n-1]): break
    hps[1] = hps[1] - hps[0]
print(hps[1])

### FIXED CODE ###

def gcd(a,b):
    r = a%b
    #print(a,b,r)
    if(r==0): return b
    return gcd(b,r)
n = int(input()) 
#n=4
hps = [int(i) for i in input().split()]
#lst = [2, 2, 8, 40]
#lst = [5, 13, 8, 1000000000]
#lst = [0, 1, 0]
    ##2 4 5 -> 1
    ## minと全ての要素のgcd
hps = sorted(hps)
for i in range(1,n):
    hps[0] = gcd(hps[i], hps[0])
#print(hps)
for i in range(len(hps)):
    if(hps[i]==0): continue
    print(hps[i])
    break
X, Y = list(map(int, input().split()))

from IPython import embed; embed(); exit();

cnt = 1
x = X
while True:
    x = 2 * x
    if x > Y:
        break
    cnt += 1
print(cnt)


### FIXED CODE ###

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

cnt = 1
x = X
while True:
    x = 2 * x
    if x > Y:
        break
    cnt += 1
print(cnt)
import math

A, B, C, D = map(int, input().split())
lcm = (C * D) // math.gcd(C, D)

def f(x):
  return B//x - (A-1)//x

print( (B - A + 1) - (f(C) + f(D) - f(lcm)) )

### FIXED CODE ###

import fractions

A, B, C, D = map(int, input().split())
lcm = (C * D) // fractions.gcd(C, D)

def f(x):
  return B//x - (A-1)//x

print( (B - A + 1) - (f(C) + f(D) - f(lcm)) )
ef main():

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

    q = deque()
    score = [0] * N
    for _ in range(Q):
        a, s = map(int, input().split())
        score[a-1] += s
    
    q.append(0)
    while q:
        tmp = q.pop()
        for v in G[tmp]:
            q.append(v)
            score[v] += score[tmp]

    print(*score)


if __name__ == '__main__':
    main()


### FIXED CODE ###

from collections import deque


def main():
    N, Q = map(int, input().split())
    g = [[] for _ in range(N)]

    # for storing the value of the each node
    cnt = [0]*N

    # for DFS
    stack = deque()
    stack.append(0)
    seen = [0] * N

    # store the structure of the graph
    for i in range(N-1):
        a, b = map(int, input().split())
        g[b-1].append(a-1)
        g[a-1].append(b-1)

    # add values to parent nodes
    for i in range(Q):
        p, x = map(int, input().split())
        cnt[p-1] += x

    # DFS
    while len(stack):
        idx = stack.pop()
        seen[idx] += 1
        for c in g[idx]:
            if seen[c]:
                continue
            cnt[c] += cnt[idx]
            stack.append(c)

    print(*cnt)


if __name__ == '__main__':
    main()
from itertools import combinations
l, r = map(int, input().split())
n = list(combinations(range(l, r+1), 2))
ans=[]
for N in n:
    ans.append(N[0]*N[1]%2019)
print(min(set(ans)))

### FIXED CODE ###

l, r=map(int,input().split())
if r-l>=2019:
    minimum=0
else:
    left,right=l%2019,r%2019
    minimum=2018**2
    for i in range(left,right+1):
        for j in range(i+1,right+1):
            minimum=min(minimum,i*j%2019)
print(minimum)
a,b = int(input().split())
S = a*b
L = 2*(a+b)
print(x,y)

### FIXED CODE ###

a,b = map(int,input().split())
S = a*b
L = 2*(a+b)
print(S,end=" ")
print(L)
print(["Odd", "Even"][int(input())*int(input())%2 == 0]

### FIXED CODE ###

a,b=map(int,input().split())
print(['Even','Odd'][a*b%2==1])
l = ['A', 'C', 'T', 'G']
s = input()
max = 0
max_temp = 0
for i in len(s):
    if s[i] in l:
        max_temp += 1
        if max < max_temp:
            max = max_temp
    else:
        max_temp = 0
print(max)

### FIXED CODE ###

l = ['A', 'C', 'T', 'G']
s = input()
max = 0
max_temp = 0
for i in s:
    if i in l:
        max_temp += 1
        if max < max_temp:
            max = max_temp
    else:
        max_temp = 0
print(max)
import math
N,D = map(int,input().split())
k = []
ans_2 = 0
ans_1 = 0
for i in range(N):
    k.append(list(map(int,input().split())))
for i in range(0,N):
    for j in range(i+1,N):
        for _ in range(D):
            now += (k[i][_]-k[j][_])**2
        ans_1 = math.sqrt(now)
        if ans_1%1 == 0:
            ans_2 += 1
        now = 0
        ans_1 = 0
print(ans_2)

### FIXED CODE ###

import math
N,D = map(int,input().split())
k = []
ans_2 = 0
ans_1 = 0
now = 0
for i in range(N):
    k.append(list(map(int,input().split())))
for i in range(0,N):
    for j in range(i+1,N):
        for _ in range(D):
            now += (k[i][_]-k[j][_])**2
        ans_1 = math.sqrt(now)
        if ans_1%1 == 0:
            ans_2 += 1
        now = 0
        ans_1 = 0
print(ans_2)
N = int(input())
L = list(map(int, input().split()))
count = 0
count2 = 0
for i in range(0, N):
  if L[i]%2==0:
    count++
    if L[i]%3==0 or L[i]%5==0:
      count2++

if count == count2:
  prin("APPROVED")
else:
  print("DENIED")


### FIXED CODE ###

N = int(input())
L = list(map(int, input().split()))
count = 0
count2 = 0
for i in range(0, N):
  if L[i]%2==0:
    count = count + 1
    if L[i]%3==0 or L[i]%5==0:
      count2 = count2 + 1

if count == count2:
  print("APPROVED")
else:
  print("DENIED")
n=int(input())
xymap=[[-1 for j in range(101)] for i in range(101)]
inp=[]
for i in range(n):
    xi,yi,hi=map(int,input().split())
    if hi==0:
        inp.append(xi,yi,hi)
        pass
    else:
            
        for x in range(101):
            for y in range(101):
                a=abs(xi-x)+abs(yi-y)+hi
                if xymap[x][y]==a or xymap[x][y]==-1 :
                    xymap[x][y]=a
                else:
                    xymap[x][y]=-2
flag=0
for x in range(101):
    for y in range(101):
        if xymap[x][y]!=-2:
            print(x,y,xymap[x][y])
            flag=1
if flag==1:
    xymap=[[-1 for j in range(101)] for i in range(101)]
    for i in range(len(inp)):
        for x in range(101):
            for y in range(101):
                if xymap[x][y]==1 or xymap[x][y]==-1 :
                    xymap[x][y]=1
                else:
                    xymap[x][y]=-2
    for x in range(101):
        for y in range(101):
            if xymap[x][y]!=-2:
                print(x,y,xymap[x][y])

### FIXED CODE ###

n=int(input())
xymap=[[-1 for j in range(101)] for i in range(101)]
inlist=[]
for i in range(n):
    xi,yi,hi=map(int,input().split())
    inlist.append([xi,yi,hi])
inlist.sort(key=lambda x :-x[2])
for i in range(n):
    xi,yi,hi=inlist[i]
    if hi==0:
        xymap[xi][yi]=-2
        for x in range(101):
            for y in range(101):
                a=abs(xi-x)+abs(yi-y)+hi
                if xymap[x][y]<=a:
                    pass
                else:
                    xymap[x][y]=-2
    else:
        for x in range(101):
            for y in range(101):
                a=abs(xi-x)+abs(yi-y)+hi
                if xymap[x][y]==a or xymap[x][y]==-1 :
                    xymap[x][y]=a
                else:
                    xymap[x][y]=-2
for x in range(101):
    for y in range(101):
        if xymap[x][y]!=-2:
            print(x,y,xymap[x][y])
dic={}
n=int(input())
d=[]
for i in range(n):
  d.append(input())
mx=0
for w in d:
  dic[w]=d.count(w)
  mx=max(mx,dic[w])

for k,v in sorted(dic.items(),key=lambda x:(x-[1],x[0])):
  if mx==v:
    print(k)
    	


### FIXED CODE ###

dic={}
n=int(input())
d=[]
for i in range(n):
  d.append(input())
  if d[-1] in dic:
  	dic[d[-1]]+=1
  else:
    dic[d[-1]]=1
mx=max(dic.values())
for k,v in sorted(dic.items(),key=lambda x:(-x[1],x[0])):
  if mx==v:
    print(k)
n = int(input())
a = list(map(int,input().split()))

import math

def comb(n, r):
    if n <= 1:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


count = 0
kaisuu = []
sum = 0
kaisuu = [0 for _ in range(n)]
for num in range(1,max(a)+1):
    count = 0
    for i in range(n):
        if a[i] == num:
            count += 1
    #kaisuu.append(count)
    kaisuu[num] = count
    sum += comb(count,2)

#print('kaisuu',kaisuu)

for k in range(n):
    ans = sum - kaisuu[a[k]] + 1
    print(ans)

### FIXED CODE ###

import collections
# import time
#start = time.time()



x=int(input())
a=list(map(int,input().split()))
 
c=collections.Counter(a)
#print(c)

num=0
for i in c.values():
    num += i*(i-1)/2
    
for i in range(x):
    print(int(num-c[a[i]]+1))
n = int(input())
p = list(map(int, input().split()))

pmin = p[0]
ans = 0
for i in range(n):
    if p[i] <= pmin:
        ans += 1
    pmin = min(pmin, p[i])

print(ans

### FIXED CODE ###

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

pmin = p[0]
ans = 0
for i in range(n):
    if p[i] <= pmin:
        ans += 1
        pmin = p[i]

print(ans)
#36
N,M = map(int,input().split())
li = []
ri = []
x = []
y = []
L,R = map(int,input().split())
for i in range(L,R+1):
    x.append(i)
for i in range(M-1):
    L,R = map(int,input().split())
    if L < x[0]:
        L = x[0]
    if R > x[-1]:
        R = x[-1]
    for j in range(L,R+1):
        y.append(j)
    x = y
    y = []
          
cou = len(x)
print(cou)
        
    
    

### FIXED CODE ###

#36
N,M = map(int,input().split())
li = []
ri = []
num = 0


for i in range(M):
    L,R = map(int,input().split())
    li.append(L)
    ri.append(R)
L = max(li)
R = min(ri)
num = R-L+1
if num <0:
    num= 0
    
print(num)
import numpy as np
 
inp = np.asarray(input().split(), dtype=int)
inp = np.sort(inp)
print(inp[2]*10+np.sum(inp[:1])

### FIXED CODE ###

import numpy as np
 
inp = np.asarray(input().split(), dtype=int)
inp = np.sort(inp)
print(np.sum(inp)+inp[2]*9)
import heapq

X,Y,Z,K = map(int,input().split())
A, B, C = [sorted(list(map(int,input().split())),reverse=True) for _ in range(3)]

Q = []
ia,ib,ic = 0,0,0
plus_i = 1
heapq.heappush(Q, [-(A[ia]+B[ib]+C[ic]),ia,ib,ic])

for _ in range(K):
  if ia+plus_i < X and [-(A[ia+plus_i]+B[ib]+C[ic]),ia+plus_i,ib,ic] not in Q:heapq.heappush(Q, [-(A[ia+plus_i]+B[ib]+C[ic]),ia+plus_i,ib,ic])
  if ib+plus_i < Y and [-(A[ia]+B[ib+plus_i]+C[ic]),ia,ib+plus_i,ic] not in Q:heapq.heappush(Q, [-(A[ia]+B[ib+plus_i]+C[ic]),ia,ib+plus_i,ic])
  if ic+plus_i < Z and[-(A[ia]+B[ib]+C[ic+plus_i]),ia,ib,ic+plus_i] not in Q:heapq.heappush(Q, [-(A[ia]+B[ib]+C[ic+plus_i]),ia,ib,ic+plus_i])
  plus_i += 1
    
[print(-heapq.heappop(Q)[0]) for _ in range(K)]

### FIXED CODE ###

import heapq

X,Y,Z,K = map(int,input().split())
A, B, C = [sorted(list(map(int,input().split())),reverse=True) for _ in range(3)]

Q = []
heapq.heappush(Q, [-(A[0]+B[0]+C[0]),0,0,0])
for _ in range(K):
  p, i, j, k = heapq.heappop(Q)
  print(-p)
  if i+1<X and [-(A[i+1]+B[j]+C[k]),i+1,j,k] not in Q: heapq.heappush(Q, [-(A[i+1]+B[j]+C[k]),i+1,j,k])
  if j+1<Y and [-(A[i]+B[j+1]+C[k]),i,j+1,k] not in Q: heapq.heappush(Q, [-(A[i]+B[j+1]+C[k]),i,j+1,k])
  if k+1<Z and [-(A[i]+B[j]+C[k+1]),i,j,k+1] not in Q: heapq.heappush(Q, [-(A[i]+B[j]+C[k+1]),i,j,k+1])
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import division, print_function
import sys


def main():
    h, w = map(int, sys.stdin.readline().strip().split(" "))
    aa = ""
    for _ in range(h):
        aa += sys.stdin.readline().strip()
    d = {}
    for c in aa:
        if c in d:
            d[c] += 1
        else:
            d[c] = 1

    # print(d)
    fours = 0
    evens = 0
    odds = 0

    for c, count in d.items():
        fours += count // 4
        evens += (count % 4) // 2
        odds += count % 2

    # print(fours, evens, odds)
    if h % 2 == 0 and w % 2 == 0:
        print("Yes" if odds == 0 and evens == 0 else "No")
    elif h % 2 == 0 and w % 2 == 1:
        print("Yes" if odds == 0 and evens * 2 == h else "No")
    elif h % 2 == 1 and w % 2 == 0:
        print("Yes" if odds == 0 and evens * 2 == w else "No")
    else:
        print("Yes" if odds == 1 and evens * 2 == w + h - 2 else "No")


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import division, print_function
import sys


def main():
    print("Yes" if sys.stdin.readline().strip().startswith("YAKI") else "No")


if __name__ == '__main__':
    main()
a

### FIXED CODE ###

a_list = []
[a_list.append(int(input())) for i in range(5)]
k = int(input())
print("Yay!") if k >= (max(a_list)-min(a_list)) else print(":(")
n, m = map(int, input().split())
print(n(n-1)//2+m(m-1)//2)

### FIXED CODE ###

n, m = map(int, input().split())
print(n*(n-1)//2+m*(m-1)//2)
a, b = input().split()

a = list(a)
b = list(b)

a = [int(a[i]) for i in range(len(a))]
b = [int(b[i]) for i in range(len(b))]

flag = True
if len(a) > len(b):
    print('GREATER')
    flag = False
elif len(b) > len(a):
    print('LESS')
    flag = False
else:
    for i in range(len(a)):
        if a[i] > b[i]:
            print('GREATER')
            flag = False
            break
        elif b[i] > a[i]:
            print('LESS')
            flag = False
            break
if flag:
    print('EQUAL')

### FIXED CODE ###

a = int(input())
b = int(input())

if a > b:
    print('GREATER')
elif b > a:
    print('LESS')
else:
    print('EQUAL')
N=int(input())
ans=1
for i in range(1,n+1):
    ans=(ans*i)%1000000007
print(ans%(10**9+7))

### FIXED CODE ###

N=int(input())
ans=1
for i in range(1,N+1):
    ans=(ans*i)%1000000007
print(ans%(10**9+7))
def MAP(): return list(map(int,input().split()))
import math

n = int(input())
A = MAP()

tmp=A[0]
for i in range(1,n):
    tmp = math.gcd(tmp,A[i])
print(tmp)

### FIXED CODE ###

def MAP(): return list(map(int,input().split()))
import fractions

n = int(input())
A = MAP()

tmp=A[0]
for i in range(1,n):
    tmp = fractions.gcd(tmp,A[i])
print(tmp)
N=int(input())
A=[int for i in input().split()]
mini=min(A)
while mini>0:
    for i in range(len(A)):
        if A[i]!=mini:
            A[i]=A[i]%mini
    z=A.count(0)
    A=sorted(A)[z:]
    m=A[0]
    if m==1:
        break
    else:
        if [i%m for i in A]==[0]*len(A):
            break
print(A[0])


### FIXED CODE ###

N = int(input())
A = [int(_) for _ in input().split()]
m = min(A)
while m > 0:
    for i in range(0,len(A)):
        if A[i] != m:
            A[i] = A[i]%m
    z = A.count(0)
    A = sorted(A)[z:]
    m = A[0]
    if m == 1:
        break
    else:
        if [_%m for _ in A] == [0]*len(A):
            break
print(m)
import numpy as np
h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]

black_list = []
used = []

for i in range(h):
  for j in range(w):
    if a[i][j] == ".":
      a[i][j] = 1
    else:
      a[i][j] = 0
      black_list.append([i, j])
a = np.array(a)

def search(a, h, w):
  a = np.array(a)
  b = np.array(a[:]).T
  for i in range(w):
    for j in range(1, h-1):
      if a[i][j] == 0:
        a[i][j-1] = 0
        a[i][j+1] = 0

  for i in range(h):
    for j in range(1, w-1):
      if b[i][j] == 0:
        b[i][j-1] = 0
        b[i][j+1] = 0
  return a*b.T

count = 0
while np.sum(a) > 0:
  a = search(a, h, w)
  count += 1

print(count)





### FIXED CODE ###

from collections import deque
h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]
moves = ((1, 0), (-1, 0), (0, 1), (0, -1))
cnt = [[float('inf') for _ in range(w)] for _ in range(h)]
ans = 0
searched = [[0 for _ in range(w)] for _ in range(h)]
q = deque([])

def bfs():
  while q:
    y, x = q.popleft()
    for dy, dx in moves:
      next_y = y + dy
      next_x = x + dx 
      if 0 <= next_y < h and 0 <= next_x < w and searched[next_y][next_x] == 0 and a[next_y][next_x] == '.' and cnt[next_y][next_x] > cnt[y][x]+1:
        searched[next_y][next_x] = 1
        q.append([next_y, next_x])
        cnt[next_y][next_x] = cnt[y][x]+1

for i in range(h):
  for j in range(w):
    if a[i][j] == '#':
      cnt[i][j] = 0
      searched[i][j] = 1
      q.append([i, j])

bfs()
for i in range(h):
  for j in range(w):
    ans = max(ans, cnt[i][j])

print(ans)
from collections import deque

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

xy = {i:[] for i in range(1,N+1)}
visited = {i:False for i in range(1,N+1)}

for _ in range(M):
  x,y,z = map(int,input().split())
  xy[x].append(y)
  xy[y].append(x)

def dfs(p):
  visited[p] = True
  for q in xy[p]:
    if visited[q]:
      pass
    else:
      dfs(q)
      
count = 0
for i in range(1,N+1):
  if visited[i]:
    continue
  else:
    count += 1
    dfs(i)
print(count)
  

### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

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

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
      
      
def main():
  n,m = map(int,input().split())
  u = UnionFind(n)
  
  for _ in range(m):
    x,y,_ = map(int,input().split())
    u.union(x-1,y-1)
  print(u.group_count())
  
if __name__ == "__main__":
  main()
N = int(input())
A = []

for i in range(N):
  tmp = int(input())
  if tmp not in A:
    A.append(tmp)
  else:
    A.romove(tmp)
    
print(len(A))

### FIXED CODE ###

from collections import Counter
N = int(input())
A = []

for i in range(N):
  tmp = int(input())
  A.append(tmp) 
B = Counter(A).values()
cnt = 0
for i in B:
  if i % 2 != 0:
    cnt += 1
  
print(cnt)