Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

n,m=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(m)]
tree=[[] for i in range(n+1)]
parent=[0]*(n+1)
count=[0]*m
for i in range(1,m+1):
    a,b=ab[-i]
    A=parent[a]
    B=parent[b]
    if A==0 and B==0:
        parent[a]=a
        parent[b]=a
        tree[a].append(b)
        count[-i]=1
    elif A==0:
        count[-i]=len(tree[B])+1
        parent[a]=B
        tree[B].append(a)
    elif B==0:
        count[-i]=len(tree[A])+1
        parent[b]=A
        tree[A].append(b)
    elif parent[a]==parent[b]:
        count[-i]=0
    else:
        A=parent[a]
        B=parent[b]
        u=len(tree[A])
        v=len(tree[B])
        count[-i]=(u+1)*(v+1)   
        for u in tree[B]:
            parent[u]=A
        parent[B]=A
        tree[A].append(B)
        tree[A]+=tree[B]
        tree[B]=[]
sum=0
for i in range(0,m):
    sum+=count[i]
    print(sum)

### FIXED CODE ###

n,m=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(m)]
tree=[[] for i in range(n+1)]
parent=[0]*(n+1)
count=[0]*m
for i in range(1,m+1):
    a,b=ab[-i]
    A=parent[a]
    B=parent[b]
    if A==0 and B==0:
        parent[a]=a
        parent[b]=a
        tree[a].append(b)
        count[-i]=1
    elif A==0:
        count[-i]=len(tree[B])+1
        parent[a]=B
        tree[B].append(a)
    elif B==0:
        count[-i]=len(tree[A])+1
        parent[b]=A
        tree[A].append(b)
    elif parent[a]==parent[b]:
        count[-i]=0
    else:
        A=parent[a]
        B=parent[b]
        u=len(tree[A])
        v=len(tree[B])
        count[-i]=(u+1)*(v+1)   
        if u<v:
            A,B=B,A
            a,b=b,a
        for u in tree[B]:
            parent[u]=A
        parent[B]=A
        tree[A].append(B)
        tree[A]+=tree[B]
        tree[B]=[]
sum=0
for i in range(0,m):
    sum+=count[i]
    print(sum)
### BUGGY CODE ###

import sys
from collections import defaultdict, deque
import bisect
from heapq import *
from math import factorial
sys.setrecursionlimit(200000)
input = sys.stdin.readline

N, M, = map(int, input().split())
# N = int(input())
# L = [int(v) for v in input().split()]
# L = [[int(v) for v in input().split()] for _ in range(N)]
# L = [int(input()) for _ in range(N)]
# L = [list(input().strip())  for _ in range(N)]
# S = input().strip()

L = []
v = 0
for _ in range(M):
    a, b = map(int, input().split())
    l = sum([1 << (int(v) - 1) for v in input().split()])
    L.append([a, b, l])
    v = v | l
if v != (1 << N) - 1:
     print(-1)
     exit()

dp = [[10 ** 18 for _ in range(1 << N)] for _ in range(M + 1)]
dp[0][0] = 0

for i in range(M):
     for j in range(1 << N):
          dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])

          dp[i + 1][j | L[i][2]] =  min(dp[i + 1][j | L[i][2]], dp[i][j] + L[i][0])

print(dp[M][(1 << N) - 1])

### FIXED CODE ###

import sys
from collections import defaultdict, deque
import bisect
from heapq import *
from math import factorial
sys.setrecursionlimit(200000)
input = sys.stdin.readline

N, M, = map(int, input().split())
# N = int(input())
# L = [int(v) for v in input().split()]
# L = [[int(v) for v in input().split()] for _ in range(N)]
# L = [int(input()) for _ in range(N)]
# L = [list(input().strip())  for _ in range(N)]
# S = input().strip()

L = []
v = 0
for _ in range(M):
    a, b = map(int, input().split())
    l = sum([1 << (int(v) - 1) for v in input().split()])
    L.append([a, b, l])
    v = v | l
if v != (1 << N) - 1:
     print(-1)
     exit()

dp = [[10 ** 18 for _ in range(1 << N)] for _ in range(M + 1)]
dp[0][0] = 0

for i in range(M):
     for j in range(1 << N):
          dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])

          dp[i + 1][j | L[i][2]] =  min(dp[i + 1][j | L[i][2]], dp[i][j] + L[i][0])

print(dp[M][(1 << N) - 1])
### BUGGY CODE ###

from itertools import product, combinations

INF = float('inf')
def floyd_warshall(V, E):
    dist = [[INF for _ in V] for _ in V]
    for v in V:
        dist[v][v] = 0
        for u, c in E[v]: dist[v][u] = c
    for k in V:        
        for i, j in product(V, repeat=2):
            if dist[i][j] > dist[i][k] + dist[k][j]:
                dist[i][j] = dist[i][k] + dist[k][j]
    return dist

N, M, L = map(int, input().split())
V = list(range(N))
E = [[] for _ in V]
for _ in range(M):
    a, b, c = map(int, input().split())
    E[a-1].append((b-1, c))
    E[b-1].append((a-1, c))

dist = floyd_warshall(V, E)
E_charge = [[] for _ in V]
for u, v in combinations(V, 2):
    if dist[u][v] <= L:
        E_charge[u].append((v, 1))
        E_charge[v].append((u, 1))
charge = floyd_warshall(V, E_charge)

Q = int(input())
for _ in range(Q):
    s, t = map(int, input().split())
    n = charge[s-1][t-1]
    print(n - 1 if n != INF else -1)

### FIXED CODE ###

from itertools import product, combinations

INF = float('inf')
def floyd_warshall(E):
    N = len(E)
    dist = [[INF for _ in range(N)] for _ in range(N)]
    for v in range(N):
        dist[v][v] = 0
        for u, c in E[v]: dist[v][u] = c
    for k in range(N):        
        for i, j in product(range(N), repeat=2):
            if dist[i][j] > dist[i][k] + dist[k][j]:
                dist[i][j] = dist[i][k] + dist[k][j]
    return dist

N, M, L = map(int, input().split())
E = [[] for _ in range(N)]
for _ in range(M):
    a, b, c = map(int, input().split())
    E[a-1].append((b-1, c))
    E[b-1].append((a-1, c))
dist = floyd_warshall(E)

E_charge = [[] for _ in range(N)]
for u, v in combinations(range(N), 2):
    if dist[u][v] <= L:
        E_charge[u].append((v, 1))
        E_charge[v].append((u, 1))
charge = floyd_warshall(E_charge)

Q = int(input())
for _ in range(Q):
    s, t = map(int, input().split())
    n = charge[s-1][t-1]
    print(n - 1 if n != INF else -1)
### BUGGY CODE ###

import math
N = int(input())
for n in range(1,N+1):
    r_n = math.floor(math.sqrt(n))
    count = 0
    if(n >= 6):
        for x in range(1,r_n):
            for y in range(1,r_n):
                for z in range(1,r_n):
                    if (x*x + y*y + z*z + x*y + y*z + z*x) == n:
                        count+=1
    print(count)

### FIXED CODE ###

import math
N = int(input())
ans = [0 for _ in range(10050)]
r_n = math.floor(math.sqrt(N))
count = 0
for x in range(1,r_n):
    for y in range(1,r_n):
        for z in range(1,r_n):
            n = x*x + y*y + z*z + x*y + y*z + z*x
            if n < 10050:
                ans[n]+=1
for i in range(N):
    print(ans[i+1])
### BUGGY CODE ###

import sys
input = sys.stdin.readline

from functools import reduce
from fractions import gcd
import numpy as np

MOD = 10**9+7

def lcm_base(x, y):
    return (x * y) // gcd(x, y)


def main():
    N = int(input())
    a = [int(i) for i in input().split()]
    A = np.array(a)

    lcm = reduce(lcm_base, a, 1)
    B = lcm // A

    print(np.sum(B) % MOD)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from functools import reduce
from fractions import gcd

MOD = 10**9+7

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def main():
    N = int(input())
    a = [int(i) for i in input().split()]

    lcm = reduce(lcm_base, a, 1)
    
    ans = 0
    for i in a:
        ans += lcm // i

    print(ans % MOD)


if __name__ == "__main__":
    main()
### BUGGY CODE ###

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

def prime_factorization(n):
  if n==1:
    return []
  else:
    i=2
    ans=[]
    while n>1:
      if n%i==0:
        n//=i
        ans.append(i)
        while n%i==0:
          n//=i
      i+=1
    return ans

A=prime_factorization(a)
B=prime_factorization(b)

ans=0
for _a in A:
  if B.count(_a):
    ans+=1
print(ans+1)


### FIXED CODE ###

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

def prime_factorization(n):
  if n==1:
    return [1]
  else:
    i=2
    ans=[]
    k=int(n**0.5)+1
    for j in range(2,k+1):
      if n==1: break
      if n%j==0:
        n//=j
        ans.append(j)
        while n%j==0:
          n//=j
    if len(ans):
      ans.append(1)
      if n!=1:
        ans.append(n)
      return ans
    else:
      return [1,n]

A=prime_factorization(a)
B=prime_factorization(b)
#print(A)
#print(B)

print(len(set(A)&set(B)))
### BUGGY CODE ###

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

def is_anagram( a, b ):
    for chr in a:
        if a.count( chr ) != b.count( chr ):
            return False
    return True

count = 0
listcnt = len(sntlist)
for i in range( listcnt-1 ):
    for j in range( i+1, listcnt ):
        if is_anagram( sntlist[i], sntlist[j] ):
            count += 1
print(count)

### FIXED CODE ###

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

dict = {} 
for i in range(n):
  charList = list(strList[i])
  charList.sort()
  key = "".join(charList)
  if not key in dict:
    dict[key] = 1
  else:
    dict[key] += 1  
 
count = 0;
for v in dict.values():
  count += (v * (v-1) // 2)
print(count)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(100000)

N=int(input())
A = []
for n in range(N):
    A.append(int(input()))


# N = 2*10**3
# A = [0 for n in range(N)]

# print(A)

visited = [False for n in range(N)]

dp = {}
def search(n,d):
    if n in dp:
        return dp[n]
    maxd = d
    for i in range(n)[::-1]:
        if i in dp:
            maxd = max(dp[i], maxd)
        elif A[i] >= A[n]:
            maxd = max(search(i,d+1), maxd)
    dp[n] = maxd
    return dp[n]

ds = [0 for n in range(N)]
for n in range(N)[::-1]:
    if not n in dp:
        ds[n] = search(n,0)

# print(ds)

print(max(ds)+1)

### FIXED CODE ###

import bisect
N=int(input())
a = []
for n in range(N):
    a.append(int(input()))

r = [-1]*N

mind = float("inf")
for n in range(N):
    ind = bisect.bisect_left(r, a[n])
    r[ind-1] = a[n]
    mind = min(mind, ind)

# print(r)
print(N-mind+1)
### BUGGY CODE ###

s = input()
x,y = map(int,input().split())
count = 0
d = []
for i in range(len(s)):
    if s[i] == 'F':
        count += 1
    else:
        d.append(count)
        count = 0
if count != 0:
    d.append(count)

dx = [d[i] for i in range(len(d)) if i%2==0]
dy = [d[i] for i in range(len(d)) if i%2==1]
if len(dx) == 0:
    dx = [0]
if len(dy) == 0:
    dy = [0]
dpx = [[] for i in range(len(dx))]
dpx[0] = [dx[0]]
dpy = [[] for i in range(len(dy))]
dpy[0] = [dy[0],-dy[0]]
for i in range(len(dx)-1):
    trans = set()
    for j in range(len(dpx[i])):
        trans.add(dpx[i][j]+dx[i+1])
        trans.add(dpx[i][j]-dx[i+1])
    dpx[i+1] = list(trans)
for i in range(len(dy)-1):
    trans = set()
    for j in range(len(dpy[i])):
        trans.add(dpy[i][j]+dy[i+1])
        trans.add(dpy[i][j]-dy[i+1])
    dpy[i+1] = list(trans)
ans = (x in dpx[-1])&(y in dpy[-1])

if ans:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s = input()
x,y = map(int,input().split())
count = 0
d = []
s = s.split('T')
d = [len(x) for x in s]

if len(d) == 0:
    d.append(0)
if len(d) == 1:
    d.append(0)
dpx = [d[0]]
dpy = [d[1],-d[1]]
for i in range(2,len(d)):
    di = d[i]
    trans = set()
    if i%2==0:
        for xj in dpx:
            trans.add(xj+di)
            trans.add(xj-di)
        dpx = list(trans)
    else:
        for yj in dpy:
            trans.add(yj+di)
            trans.add(yj-di)
        dpy = list(trans)
ans = (x in dpx)&(y in dpy)

if ans:
    print('Yes')
else:
    print('No')
### BUGGY CODE ###

N,Q=[int(s) for s in input().split()]
edge=[set() for _ in range(N)]
value=[0 for _ in range(N)]
for i in range(N-1):
  x,y=[int(s) for s in input().split()]
  edge[x-1].add(y-1)
  edge[y-1].add(x-1)
for i in range(Q):
  x,y=[int(s) for s in input().split()]
  value[x-1]+=y
stack=[0]
while stack:
  vrt=stack.pop(0)
  for to in edge[vrt]:
    stack.append(to)
    edge[to].discard(vrt)
    value[to]+=value[vrt]
print(*value)


### FIXED CODE ###

N,Q=[int(s) for s in input().split()]
#辺でつながれた場所をすべてリストアップ
con_list=[set() for s in range(N+1)]
for i in range(N-1):
  a,b=[int(s) for s in input().split()]
  con_list[a].add(b)
  con_list[b].add(a)

v_list=[0 for s in range(N+1)]
for i in range(Q):
  x,y=[int(s) for s in input().split()]
  v_list[x]+=y

position=1 #現在位置
counter=v_list[1] #カウンター
ans_list=[0 for s in range(N+1)] #答え
ans_list[1]=counter 
vertex_num=1 #訪れた場所の数
oya_list=[-1 for s in range(N+1)] #親に戻るためのリスト

while vertex_num<N:
  #まだ行っていない子があるか？
  if len(con_list[position])>0:
    x=con_list[position].pop()
    con_list[x].remove(position) #xの行先から親を消す
    oya_list[x]=position
    position=x
    counter+=v_list[position] #カウンターの更新
    ans_list[position]=counter
    vertex_num+=1
  else: #行き先がないなら戻る
    position=oya_list[position]
    counter=ans_list[position] #カウンターを戻す
print(*ans_list[1:])
### BUGGY CODE ###

N = int(input())
L = [input() for i in range(N)]

list_val = list(set(L))
list_size = [0]*N
for i,v in enumerate(list_val):
    list_size[i] = L.count(v)

max_size = max(list_size)

ans = []
while max(list_size) == max_size:
    max_idx = list_size.index(max_size)
    ans.append(list_val[max_idx])
    list_size[max_idx] = 0
print("\n".join(sorted(ans)))


### FIXED CODE ###

import collections

N = int(input())

s = [input() for i in range(N)]

c = collections.Counter(s)
max_n = max(c.values())

ans = []
for key, val in c.items():
  if val == max_n:
    ans.append(key)
print("\n".join(sorted(list(set(ans)))))
### BUGGY CODE ###

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

H, W = lr()
A = [lr() for _ in range(H)]
B = [lr() for _ in range(H)]
diff = [[0] * W for _ in range(H)]
for i in range(H):
    for j in range(W):
        diff[i][j] = abs(A[i][j] - B[i][j])

dp = [[[False] * 600000 for j in range(W)] for i in range(H)]
dp[0][0][diff[0][0]] = True
for i in range(H):
    for j in range(W):
        for k in range(600000):
            if dp[i][j][k]:
                if i < H-1:
                    dp[i+1][j][abs(k+diff[i+1][j])] = True
                    dp[i+1][j][abs(k-diff[i+1][j])] = True
                if j < W-1:
                    dp[i][j+1][abs(k+diff[i][j+1])] = True
                    dp[i][j+1][abs(k-diff[i][j+1])] = True

for k in range(100):
    if dp[H-1][W-1][k] == True:
        answer = k
        break

print(answer)


### FIXED CODE ###

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

H, W = lr()
A = [lr() for _ in range(H)]
B = [lr() for _ in range(H)]
diff = [[0] * W for _ in range(H)]
for i in range(H):
    for j in range(W):
        diff[i][j] = abs(A[i][j] - B[i][j])

X = (H+W) * 80
L = X + X + 1 #真ん中を0とする、最後に-X
dp = [[None] * W for _ in range(H)]
dp[0][0] = np.zeros(L, np.bool)
dp[0][0][X+diff[0][0]] = 1; dp[0][0][X-diff[0][0]] = 1 #非負整数のみでも良い
for h in range(H):
    for w, di in enumerate(diff[h]):
        if h == 0 and w == 0:
            continue
        x = np.zeros(L, np.bool)
        if h > 0:
            x[di:] |= dp[h-1][w][:L-di]
            x[:L-di] |= dp[h-1][w][di:]
        if w > 0:
            x[di:] |= dp[h][w-1][:L-di]
            x[:L-di] |= dp[h][w-1][di:]
        dp[h][w] = x

dp = dp[-1][-1]
possible = np.where(dp)[0] - X
answer = np.abs(possible).min()
print(answer)
# 07
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10000)

def calc(x,y):
    i = len(x)
    j = len(y)
    if not d[i][j] == None:
        return d[i][j]
    else:
        if x[-1] == y[-1]:
            tmp = max(calc(x[:-1],y[:-1])+1,calc(x[:-1],y),calc(x,y[:-1]))
            d[i][j] = tmp
            return tmp
        else:
            tmp = max(calc(x[:-1],y),calc(x,y[:-1]))
            d[i][j] = tmp
            return tmp
        
q = int(input())
for i in range(q):
    x = input()
    y = input()
    d = [[0 if i == 0 or j == 0 else None for i in range(len(y)+1)] for j in range(len(x)+1)]
    print(calc(x,y))


### FIXED CODE ###

def calc(x,y):
    n = len(x)
    m = len(y)
    dp1 = [0]*(m+1)
    for i in range(n):
        s = x[i]
        dp2 = dp1[:]
        for j in range(m):
            if s == y[j]:
                dp1[j+1] = dp2[j]+1
            elif dp1[j+1] < dp1[j]:
                dp1[j+1] = dp1[j]
    return dp1[-1]

q = int(input())
for i in range(q):
    x = input()
    y = input()
    print(calc(x,y))
### BUGGY CODE ###

N = int(input())
A = [int(input()) for i in range(N)]
print(sum([1 for a in A if A.count(a)%2==1]))

### FIXED CODE ###

s = set()

for i in range(int(input())):
  s^={input()}

print(len(s))
### BUGGY CODE ###

# -*- coding: utf-8 -*-
from bisect import bisect
def inpl(): return tuple(map(int, input().split()))

N, A, B = inpl()
D = A-B
H = []
res = 0
for _ in range(N):
    H.append(int(input()))

x = sum(H) // (A+B*(N-1))
H = sorted(H)
 
while len(H):
    nH = [h - B*x for h in H]
    i = bisect(nH, 0)
    nH = nH[i:]
    H = H[i:]
    if sum([h//D + (h%D>0) for h in nH]) <= x:
        print(x)
        break
    else:
        x += 1

### FIXED CODE ###

# -*- coding: utf-8 -*-
def inpl(): return tuple(map(int, input().split()))

N, A, B = inpl()
D = A-B
H = []
res = 0
for _ in range(N):
    H.append(int(input()))

H = sorted(H)
l = sum(H) // (A+B*(N-1))
r = sum([h//A + (h%A>0) for h in H])

def judge(m):
    nH = [h - B*m for h in H]
    if sum([h//D + (h%D>0) for h in nH if h > 0]) <= m:
        return True
    else:
        return False

while r-l > 1:
    mid = (l+r)//2
    if judge(mid):
        r = mid
    else:
        l = mid
if judge(l):
    print(l)
else:
    print(r)
### BUGGY CODE ###

H,W = list(map(int,input().split()))
Ch,Cw = list(map(int,input().split()))
Dh,Dw = list(map(int,input().split()))
Ch,Cw,Dh,Dw = Ch-1,Cw-1,Dh-1,Dw-1

from collections import deque
maze = []
for i in range(H):
    maze.append(list(input()))
times = [[10000000]*W for i in range(H)]

dh = [1, 0, -1, 0]
dw = [0, 1, 0, -1]
que = deque([])
que.append((Ch, Cw))
times[Ch][Cw] = 0
cnt = 0
flag = 0
while flag==0:
    loc = deque([])
    while que:
        p = que.popleft()
        loc.append(p)
        if p[0] == Dh and p[1] == Dw:
            times[Dh][Dw] = cnt
            flag = 1
            break
        for i in range(4):
            nh = p[0] + dh[i]
            nw = p[1] + dw[i]
            if (0<=nh<H)and(0<=nw<W)and(maze[nh][nw]!="#")and(times[nh][nw]==10000000):
                que.append((nh, nw))
                times[nh][nw] = cnt
    que = deque([])
    while loc:
        p = loc.popleft()
        for i in range(-2,3):
            for j in range(-2,3):
                nh = p[0] + i
                nw = p[1] + j
                if (0<=nh<H)and(0<=nw<W)and(maze[nh][nw]!="#")and(times[nh][nw]==10000000):
                    que.append((nh, nw))
    if len(que)==0:
        break
    cnt += 1

if times[Dh][Dw] == 10000000:
    print(-1)
else:
    print(times[Dh][Dw])

### FIXED CODE ###

from collections import deque
H, W = map(int, input().split())
si, sj = map(int, input().split())
gi, gj = map(int, input().split())
si, sj, gi, gj = si-1+2, sj-1+2, gi-1+2, gj-1+2
X = [[1] * (W + 4)] * 2 + [[1] * 2 + [1 if a == "#" else 0for a in input()] + [1] * 2 for _ in range(H)] + [[1] * (W + 4)] * 2
H += 4
W += 4

Y = [(-1, 0), (0, -1), (0, 0), (0, 1), (1, 0)]
Z = [(-2, -2), (-2, -1), (-2, 0), (-2, 1), (-2, 2), (-1, -2), (-1, -1), (-1, 1), (-1, 2), (0, -2), (0, 2), (1, -2), (1, -1), (1, 1), (1, 2), (2, -2), (2, -1), (2, 0), (2, 1), (2, 2)]

def BFS():
    Q = deque([(si, sj)])
    D = [-1] * (H * W)
    D[si*W + sj] = 0
    while Q:
        i, j = Q.popleft()
        x = i * W + j
        for di, dj in Y:
            ni, nj = i+di, j+dj
            y = ni * W + nj
            if X[ni][nj] == 0:
                if D[y] == -1 or D[y] > D[x]:
                    D[y] = D[x]
                    Q.appendleft((ni, nj))
        for di, dj in Z:
            ni, nj = i+di, j+dj
            y = ni * W + nj
            if X[ni][nj] == 0:
                if D[y] == -1:
                    D[y] = D[x] + 1
                    Q.append((ni, nj))
    return D[gi * W + gj]

print(BFS())
### BUGGY CODE ###

C = ["dream","dreamer","erase","eraser"]
S = input()
N = len(S)
T = [(0,"")]
ans = "NO"
while T:
    t = T.pop()
    if t[0]>N:continue
    if t[0]==N and t[1]==S:
        ans="YES"
    if t[1]!=S[:t[0]]:continue
    for c in C:
        T.append((t[0]+len(c),t[1]+c))
print(ans)

### FIXED CODE ###

S = input()[::-1]
N = len(S)
T = ""
n = 0
C = ["maerd","remaerd","esare","resare"]
while n<N:
    if S[n]=="m":
        T+=C[0]
        n+=5
    elif S[n]=="e":
        T+=C[2]
        n+=5
    elif S[n]=="r":
        if N-n<6:break
        if S[n+2]=="m":
            T+=C[1]
            n+=7
        elif S[n+2]=="s":
            T+=C[3]
            n+=6
        else:break
    else:break
print("YES" if S==T else "NO")
### BUGGY CODE ###

#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
a_list = list(map(int, input().split()))

for i in range(1, 10**9):
    x_list = [i]
    k = 0
    for i in range(1, n):
        x = a_list[0] ^ a_list[i] ^ x_list[0]
        x_list.append(x)
        k = k ^ x
    if a_list[0] == k:
        for i in range(0, n):
            print(x_list[i], end=" ")
        break

### FIXED CODE ###

#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
a_list = list(map(int, input().split()))
y = 0
for a in a_list:
    y = y ^ a
for a in a_list:
    x = y ^ a
    print(x, end=" ")
### BUGGY CODE ###

import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


class Solver(object):
    def __init__(self):
        pass

    def solve(self, n, arr):
        sum = 0
        bitcount = [0]*100
        for num in arr:
            for i in range(1, 100):
                if bin(num)[-i] == "b":
                    break
                bitcount[i-1] += int(bin(num)[-i])
        for i, b in enumerate(bitcount):
            sum += b * (n-b) * 2**i
        return sum % (10**9 + 7)


def main():
    N = int(input())
    A_l = [int(i) for i in input().split()]
    solver = Solver()
    print(solver.solve(N, A_l))


if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def solve(n, arr):
    sum = 0
    bitcount = [0]*100
    for num in arr:
        b = reversed(bin(num)[2:])
        for i, s in enumerate(b):
            if i != "0":
                bitcount[i] += int(s)
    for i, b in enumerate(bitcount):
        sum += b * (n-b) * 2**i
    return sum % (10**9 + 7)


def main():
    N = int(input())
    A_l = [int(i) for i in input().split()]
    print(solve(N, A_l))


if __name__ == "__main__":
    main()
### BUGGY CODE ###

import sys
sys.setrecursionlimit(200000)

N = int(input())
MOD = 10 ** 9 + 7

to = [set() for _ in range(N)]
for _ in range(N-1):
    x, y = map(int, input().split())
    to[x-1].add(y-1)
    to[y-1].add(x-1)

visited = [False] * N
def dfs(n):
    visited[n] = True
    w = 1
    b = 1
    for i in to[n]:
        if visited[i] == False:
            rw, rb = dfs(i)
            w *= rw + rb
            b *= rw
    w %= MOD
    b %= MOD
    return (w,b)

ans = dfs(0)
print((ans[0] + ans[1]) % MOD)

### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)

N = int(input())
MOD = 10 ** 9 + 7

to = [[] for _ in range(N)]
for _ in range(N-1):
    x, y = map(int, input().split())
    to[x-1].append(y-1)
    to[y-1].append(x-1)

def dfs(n,p):
    w = 1
    b = 1
    for i in to[n]:
        if i != p:
            rw, rb = dfs(i, n)
            w *= (rw + rb)
            w %= MOD
            b *= rw
            b %= MOD
    return (w,b)

ans = dfs(0, -1)
print((ans[0] + ans[1]) % MOD)