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

def eratosthenes(N):
    is_prime = {i: True for i in range(2, N+1)}
    primes = []
    for i in range(2, N+1):
        if is_prime[i]:
            primes.append(i)
            if i**2 <= N:
                for j in range(i**2, N+1, i):
                    is_prime[j] = False
    return primes


def gcd(a, b):
    a, b = max(a, b), min(a, b)
    if b == 0:
        return a
    return gcd(b, a % b)


def main():
    N = int(input())
    A = list(map(int, input().split()))
    allgcd = A[0]
    primes = eratosthenes(1000)
    divs = set()
    pairwise_coprime = True
    for a in A:
        allgcd = gcd(allgcd, a)
        if not pairwise_coprime:
            continue
        for p in primes:
            if a % p == 0:
                if p in divs:
                    pairwise_coprime = False
                while a % p == 0:
                    a //= p
                divs.add(p)
        if a != 1:
            if a in divs:
                pairwise_coprime = False
            divs.add(a)
    if pairwise_coprime:
        print("pairwise coprime")
    else:
        if allgcd == 1:
            print("setwise coprime")
        else:
            print("not coprime")


if __name__ == "__main__":
    main()


### FIXED CODE ###

def eratosthenes(N):
    is_prime = {i: True for i in range(2, N+1)}
    primes = []
    for i in range(2, N+1):
        if is_prime[i]:
            primes.append(i)
            if i**2 <= N:
                for j in range(i**2, N+1, i):
                    is_prime[j] = False
    return primes


def gcd(a, b):
    a, b = max(a, b), min(a, b)
    if b == 0:
        return a
    return gcd(b, a % b)


def main():
    N = int(input())
    A = list(map(int, input().split()))
    allgcd = A[0]
    primes = eratosthenes(1000)
    divs = set()
    pairwise_coprime = True
    for a in A:
        if allgcd > 1:
            allgcd = gcd(allgcd, a)
        if not pairwise_coprime:
            continue
        for p in primes:
            if a % p == 0:
                if p in divs:
                    pairwise_coprime = False
                while a % p == 0:
                    a //= p
                divs.add(p)
            if a == 1:
                break
        if a != 1:
            if a in divs:
                pairwise_coprime = False
            divs.add(a)
    if pairwise_coprime:
        print("pairwise coprime")
    else:
        if allgcd == 1:
            print("setwise coprime")
        else:
            print("not coprime")


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

import sys

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def solve():
    H, W, N = map(int, sys.stdin.readline().split())
    nb = [0] * 10
    dx = (1, 0, -1, 0, 1, 1, -1, -1)
    dy = (0, 1, 0, -1, 1, -1, 1, -1)
    bb = []

    for lp in range(N):
        a, b = map(int, sys.stdin.readline().split())
        a, b = a-1, b-1

        if in_field(H, W, a, b):
            bb.append((a,b))

        for i in range(len(dx)):
            if in_field(H, W, a+dx[i], b+dy[i]):
                bb.append((a+dx[i], b+dy[i]))

    bb.sort()
    cnt = 0

    for i, box in enumerate(bb):
        if i == 0:
            cnt += 1
            continue
        if box != bb[i-1]:
            nb[cnt] += 1
            cnt = 1
        else:
            cnt += 1

    if cnt > 0:
        nb[cnt] += 1

    nb[0] = (W-2)*(H-2) - sum(nb)

    print(*nb, sep='\n')

def in_field(H, W, a, b):
    return (1 <= a <= H-2) and (1 <= b <= W-2)

if __name__ == '__main__':
    solve()

### FIXED CODE ###

import sys

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def solve():
    H, W, N = map(int, sys.stdin.readline().split())
    nb = [0] * 10
    bm = dict()
    bb = set()

    for lp in range(N):
        a, b = map(int, sys.stdin.readline().split())
        a, b = a-1, b-1
        res = search(H, W, bm, bb, a, b)

        if 1 <= a <= H-2 and 1 <= b <= W-2:
            bm[a,b] = 1 + res
        
        bb.add((a,b))

    # debug(bm, locals())
    for i in bm.values():
        nb[i] += 1

    nb[0] = (H-2)*(W-2) - sum(nb)

    print(*nb, sep='\n')

def search(H, W, bm, bb, a, b):
    res = 0
    dx = (1, 0, -1, 0, 1, 1, -1, -1)
    dy = (0, 1, 0, -1, 1, -1, 1, -1)

    for j in range(8):
        if (a + dx[j], b + dy[j]) in bb:
            res += 1

        if a + dx[j] < 1 or a + dx[j] > H - 2:
            continue
        if b + dy[j] < 1 or b + dy[j] > W - 2:
            continue

        if (a + dx[j], b + dy[j]) not in bm:
            bm[a + dx[j], b + dy[j]] = 0

        bm[a + dx[j], b + dy[j]] += 1

    return res

if __name__ == '__main__':
    solve()
### BUGGY CODE ###

N = int(input())
P = list(map(int, input().split()))
c = 0
for i in range(N):
  flag = True
  for j in range(i):
    if P[j] < P[i]:
      flag = False
      break
  if flag:
    c += 1
print(c)

### FIXED CODE ###

N = int(input())
P = list(map(int, input().split()))
c = 1
tmp = P[0]
for i in range(1,N):
  tmp = min(tmp,P[i-1])
  if tmp >= P[i]:
    c += 1
print(c)
### BUGGY CODE ###

import numpy as np
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall

N = int(input())
abc = [list(map(int, input().split())) for _ in range(N - 1)]
Q, K = map(int, input().split())
xy =  [list(map(int, input().split())) for _ in range(Q)]

li = [[0] * (N) for _ in range(N)]

for a, b, c in abc:
  li[a-1][b-1] = c
  li[b-1][a-1] = c
  
nli = np.array(li)
nnli = np.where(nli == 0, 10**12, nli)

G = csgraph_from_dense(nnli, null_value=10**12)
d = floyd_warshall(G)

for x, y in xy:
  print(int(d[x-1, K-1] + d[K-1, y-1]))

### FIXED CODE ###

def BFS(K, edges, N):
  roots = [ [] for i in range(N)]
  for a, b, c in edges:
    roots[a-1] += [(b-1, c)]
    roots[b-1] += [(a-1, c)]
  dist = [-1] * N
  stack = []
  stack.append(K)
  dist[K] = 0
  while stack:
    label = stack.pop(-1)
    for i, c in roots[label]:
      if dist[i] == -1:
        dist[i] = dist[label] + c
        stack += [i]
  return dist

N = int(input())
abc = [list(map(int, input().split())) for _ in range(N - 1)]
Q, K = map(int, input().split())
xy =  [list(map(int, input().split())) for _ in range(Q)]

distance = BFS(K - 1, abc, N)
for x, y in xy:
  print(distance[x - 1] + distance[y - 1])
### BUGGY CODE ###

N, K = map(int, input().split())
P = list(map(int, input().split()))

V = [0] * (N + 1)

for i in range(N):
    V[i + 1] = V[i] + sum(range(1, P[i] + 1)) / P[i]

# print(V)

res = 0
for i in range(N + 1 - K):
    res = max(res, V[i + K] - V[i])

print(res)


### FIXED CODE ###

N, K = map(int, input().split())
P = list(map(int, input().split()))

V = [0] * (N + 1)
S = [0] * (1010)
for i in range(1009):
    S[i + 1] = S[i] + (i + 1)
# print(S)

for i in range(N):
    p = P[i]
    V[i + 1] = V[i] + S[p] / p

# print(V)

res = 0
for i in range(N + 1 - K):
    res = max(res, V[i + K] - V[i])

print(res)
### BUGGY CODE ###

def main():
    N = int(input())
    lst = list(map(int, input().split()))
    ans = 1
    for i in range(N):
        if lst[i] == 0:
            print(0)
            return 0
        ans *= lst[i]

    if ans > 10 ** 18:
        print(-1)
    else:
        print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    _ = input()
    lst = list(map(int, input().split()))
    ans = 1

    if 0 in lst:
        print(0)
        exit()
    for i in lst:
        ans *= i
        if ans > 10 ** 18:
            print(-1)
            exit()
    print(ans)


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

# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
can_moves = []
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
cities = [N, 0, 0, 0, 0, 0]
time = 0
for t in range(1, 10**15):
  for i in reversed(range(len(cities) - 1)):
    if cities[i] != 0:
      cities[i] -= can_moves[i]
      cities[i+1] += can_moves[i]
      if cities[i] < 0:
        cities[i+1] += cities[i]
        cities[i] = 0
  if cities[-1] == N:
    time = t
    # print(cities)
    break
  
# 出力
print(time)

### FIXED CODE ###

# -*- coding: utf-8 -*-
# 整数の入力
import math
N = int(input())
can_moves = []
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
min_can_moves = min(can_moves)
time = math.ceil(N / min_can_moves) + len(can_moves) - 1
  
# 出力
print(time)
### BUGGY CODE ###

n = int(input())
for m in range(1, n+1):
    cnt = 0
    for i in range(1, int(n**0.5)+2):
        a = n - i**2
        if a >= 1:
            for j in range(1, int(a**0.5) + 2):
                b = n - i**2 - j**2
                if b >= 1:
                    for k in range(1, int(b**0.5) + 2):
                        if i**2 + j**2 + k**2 + i*j + j*k + k*i == m:
                            cnt += 1
    print(cnt)

### FIXED CODE ###

n = 10005
f = [0]*10005
for i in range(1, int(n**0.5)):
    a = n - i**2
    if a >= 1:
        for j in range(1, int(a**0.5)):
            b = n - i**2 - j**2
            if b >= 1:
                for k in range(1, int(b**0.5)):
                    c = i**2 + j**2 + k**2 + i*j + j*k + k*i
                    if c <= 10001:
                        f[c] += 1

n = int(input())
for i in range(1, n+1):
    print(f[i])
### BUGGY CODE ###

n=int(input())
h=list(map(int,input().split()))
mn=min(h)
cnt=0
if(mn!=1):
    print("-1")
    exit()
r=len(h)
for i in range(r-1):
    if i==r:
        break
    for j in range(r-1):
        if(h[i]==i+1):
            break
        else:
            cnt=cnt+1
            del h[i]
            r=len(h)
print(cnt)


### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
mn=min(h)
cnt=0
if(mn!=1):
    print("-1")
    exit()
i=1
for k in h:
    if(k==i):
        i=i+1
    else:
        cnt=cnt+1
print(cnt)
### BUGGY CODE ###

N,M = map(int, input().split())
s = N
c = M
while 2*s<c:
  s = s+1
  c = c-2
print(c//2)

### FIXED CODE ###

N,M = map(int, input().split())
s = N
c = M
if 2*N>=M:
  print(M//2)
else:
  t = 2*s+c
  print(t//4)
### BUGGY CODE ###

N = int(input())
S = input()

ans = 0

for i in range(N-2):
    for j in range(i+1, N-1):
        set_ij = set([S[i], S[j]])
        if len(set_ij) == 2:
            sk = ({"R", "G", "B"} - set_ij).pop()
            if 2*j - i < N and S[2*j - i] == sk:
                ans += S[j+1:].count(sk) - 1
            else:
                ans += S[j+1:].count(sk)

print(ans)


### FIXED CODE ###

N = int(input())
S = input()
ans = S.count("R") * S.count("G") * S.count("B")

for i in range(N-2):
    for d in range(1, (N-i-1)//2+1):
        if {S[i], S[i+d], S[i+2*d]} == {"R", "G", "B"}:
            ans -= 1

print(ans)
### BUGGY CODE ###

mod=10**9+7
ferumaC=300000
fac=[0 for i in range(ferumaC)]
fac[0]=1
ifac=[0 for i in range(ferumaC)]
ifac[0]=1
def mpow(x,n):
    num=1
    while n > 0:
        if n&1:
            num=num*x%mod
        x=x*x%mod
        n=n>>1
    return(num)

for i in range(0,ferumaC-1):
    fac[i+1]=(fac[i]*(i+1))%mod
    ifac[i+1]=ifac[i]*mpow(i+1,mod-2)%mod
def comb(a,b):
    if a==0 and b==0:return(1)
    if a<b or a<0:return(0)
    tmp=ifac[a-b]*ifac[b]%mod
    return(tmp*fac[a]%mod)


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

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

value=A[0]
for i in range(1,N):
    value=lcm(value,A[i])
count=0
for a in A:
    count+=value*(mpow(a,mod-2))%mod
    count%=mod
print(count)


### FIXED CODE ###

mod=10**9+7
ferumaC=300000
fac=[0 for i in range(ferumaC)]
fac[0]=1
ifac=[0 for i in range(ferumaC)]
ifac[0]=1
def mpow(x,n):
    num=1
    while n > 0:
        if n&1:
            num=num*x%mod
        x=x*x%mod
        n=n>>1
    return(num)

for i in range(0,ferumaC-1):
    fac[i+1]=(fac[i]*(i+1))%mod
    ifac[i+1]=ifac[i]*mpow(i+1,mod-2)%mod
def comb(a,b):
    if a==0 and b==0:return(1)
    if a<b or a<0:return(0)
    tmp=ifac[a-b]*ifac[b]%mod
    return(tmp*fac[a]%mod)


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

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

value=A[0]
for i in range(1,N):
    value=lcm(value,A[i])
value%=mod
count=0
for a in A:
    count+=value*(mpow(a,mod-2))%mod
    count%=mod
print(count)
### BUGGY CODE ###

m = int(input())
a = []
for _ in range(m):
  a.append(int(input()))

# a = [2, 1, 4, 5, 3]
# m = len(a)

cs = [0]*m
c_maxs = [a[0]]
minimum = a[0]
maximum = a[0]

for i in range(1, m):
  cont = False
  
  if a[i] <= minimum:
    cont = False
    minimum = a[i]
  elif maximum < a[i]:
    cont = True
    cs[i] = len(c_maxs)-1
    c_maxs[-1] = a[i]
    maximum = a[i]
  else:
    for c, c_max in enumerate(c_maxs):
      if c_max < a[i]:
        cs[i] = c
        c_maxs[c] = a[i]
        cont = True
        break
  
  if not cont:
    cs[i] = len(c_maxs)
    c_maxs.append(a[i])

# print(cs)
print(len(c_maxs))

### FIXED CODE ###

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

a = list(map(lambda x: -x, a))
m = len(a)

lis = [float('inf')]*m

for x in a:
  lis[bisect.bisect_right(lis, x)] = x

print(len([x for x in lis if not (x == float('inf'))]))
### BUGGY CODE ###

n = int(input())

p = 1
for i in range(1, n+1):
    p *= i
print(p%(10**9+7))


### FIXED CODE ###

import math
n = int(input())
print(math.factorial(n)%(10**9+7))
### BUGGY CODE ###

import fractions as fr
import copy
from functools import reduce

N = int(input())
yaku = [0]*N
X = input().split()
X = list(map(int, X))


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


for i in range(N):
    Xwork = copy.copy(X)
    del(Xwork[i])
    yaku[i] = gcd_list(Xwork)

print(max(yaku))


### FIXED CODE ###

from fractions import gcd
N = int(input())
A = list(map(int,input().split()))
L_A = [0] * (N+1)
R_A = [0] * (N+1)
for i in range(N):
    L_A[1+i] = gcd(L_A[i], A[i])
for i in reversed(range(N)):
    R_A[i] = gcd(R_A[i+1], A[i])
print(max(gcd(L_A[i], R_A[i+1]) for i in range(N)))
### BUGGY CODE ###

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

a_list = []
b_list = []
c_list = []
for i in range(M):
    a, b = list(map(int, input().split()))
    a_list.append(a)
    b_list.append(b)
    c = 0
    for one in list(map(int, input().split())):
        c |= 1<<(one-1)
    c_list.append(c)

INF = 1001001001

import numpy as np
dp = np.zeros(1<<N)+INF
dp[0] = 0
for s in range(1<<N):
    for i in range(M):
        t = c_list[i] | s
        cost = a_list[i]+dp[s]
        dp[t] = min(dp[t], cost)

if dp[-1]==INF:
    print(-1)
else:
    print(int(dp[-1]))


### FIXED CODE ###

INF = 1000000000

N, M = list(map(int, input().split()))
a_list = []
c_list = []
for i in range(M):
    a, _ = list(map(int, input().split()))
    a_list.append(a)
    c = 0
    for one in list(map(int, input().split())):
        c |= 1<<(one-1)
    c_list.append(c)

dp = [INF]*(1<<N)
dp[0] = 0
for s in range(1<<N):
    for i in range(M):
        t = c_list[i] | s
        cost = a_list[i]+dp[s]
        dp[t] = min(dp[t], cost)

if dp[-1]==INF:
    print(-1)
else:
    print(int(dp[-1]))
### BUGGY CODE ###

# D-Knapsack 1
N,W = map(int,input().split())
Weight = [0 for _ in range(N)]
Value = [0 for _ in range(N)]
for i in range(N):
    Weight[i],Value[i] = map(int,input().split())

dp = [[0 for i in range(W+1)] for j in range(N+1)]

for i in range(N):
    # あらゆる合計重量sum_wに対して品物iを入れるべきか計算する
    for sum_w in range(W+1):
        # i番目を選ぶ場合
        if sum_w - Weight[i] >= 0:
            dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w - Weight[i]] + Value[i])

        #　i番目を選ばない場合
        dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w])

# for d in dp:
#     print(d)

print(dp[N][W])

### FIXED CODE ###

# D-Knapsack 1
N,W = map(int,input().split())
Weight = [0 for _ in range(N)]
Value = [0 for _ in range(N)]
for i in range(N):
    Weight[i],Value[i] = map(int,input().split())

MAX_N = 110
MAX_V = 100100
dp = [[10**15 for i in range(MAX_V)] for j in range(MAX_N)]
dp[0][0] = 0

for i in range(N):
    # あらゆる合計重量sum_wに対して品物iを入れるべきか計算する
    for sum_v in range(MAX_V):
        # i番目を選ぶ場合
        if sum_v - Value[i] >= 0:
            dp[i+1][sum_v] = min(dp[i+1][sum_v], dp[i][sum_v - Value[i]] + Weight[i])

        # i番目を選ばない場合
        dp[i+1][sum_v] = min(dp[i+1][sum_v], dp[i][sum_v])


ans = 0
for sum_v in range(MAX_V):
    if dp[N][sum_v] <= W:
        ans = sum_v
print(ans)
### BUGGY CODE ###

import fractions
from functools import reduce

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

p = 10**9+7

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

lcm = lcm_list(A)

B = [lcm//i for i in A]

print(sum(B)%p)

### FIXED CODE ###

import fractions
from functools import reduce

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

p = 10**9+7

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

lcm = lcm_list(A)

B = [lcm//i for i in A]

print(sum(B)%p)
### BUGGY CODE ###

N= int(input())
P = [int(i) for i in input().split()] 
C = N

for i in range(N):
	if min(P[0:i+1]) != P[i]:
		C -= 1
print(C)


### FIXED CODE ###

N= int(input())
P = [int(i) for i in input().split()] 
C = N
D = P[0]
for i in range(1, N, 1):
	D = min(D,P[i])
	if D != P[i]:
		C -= 1
print(C)
### BUGGY CODE ###

def main():
    import sys
    from collections import deque

    n,m = map(int,input().split())
    abl =[[]for i in range(n)]
    for i in range(m):
        a,b = map(int,input().split())
        abl[a-1].append(b)
        abl[b-1].append(a)

    an=[0]*(n-1)
    i=1
    wk=deque([i])
    wwk=deque([])
    il=deque(abl[0])

    while any(wk):
        i=wk.pop()
        il=deque(abl[i-1])
        for k in range(len(il)):
            iwk=il.pop()
            if an[iwk-2]==0 and iwk>1:
                wwk.append(iwk)
                an[iwk-2]=i
                if all(an):
                    print('Yes')
                    for i in an:
                        print(i)
                    sys.exit()
        if not(any(wk)):
            wk=deque(wwk)
            wwk=deque([])
    print('No')

main()

### FIXED CODE ###

def main():
    from collections import deque
 
    n,m =map(int,input().split())
    abl=[[] for i in range(n+1)]
    for i in range(m):
        a,b = map(int,input().split())
        abl[a].append(b)
        abl[b].append(a)
 
    an=[0]*(n+1)
    an[0]=1
    tg = deque([1])
    while len(tg):
        itg = tg.popleft()
        for j in abl[itg]:
            if an[j]==0:
                an[j]=itg
                tg.append(j)

    if all(an):
        print('Yes')
        for j in an[2:]:
            print(j)
    else:
        print('No')
 
main()
### BUGGY CODE ###

import queue

h, w = list(map(int, input().split()))
smat = [input() for _ in range(h)]

def bfs(x0, y0):
    dist = {}
    q = queue.Queue()
    q.put((x0, y0, -1))

    while not q.empty():
        x, y, d = q.get()
        nd = d + 1
        dist[(x, y)] = nd

        for dx, dy in [(-1, 0), (0, -1), (+1, 0), (0, +1)]:
            nx = x + dx
            ny = y + dy
            if not (0 <= nx < h) or not (0 <= ny < w):
                # bound check
                continue
            if smat[nx][ny] == '#':
                # cell attr check
                continue
            if (nx, ny) in dist:
                # already visited
                continue
            v = (nx, ny, nd)
            q.put(v)
    
    mx_key = max(dist, key=lambda k: dist[k])
    #print('x0, y0, mx_key = ', x0, y0, mx_key, dist[mx_key])
    return dist[mx_key]

mxall = 0
for x0 in range(h):
    for y0 in range(w):
        if smat[x0][y0] == '.':
            mx = bfs(x0, y0)
            mxall = max(mxall, mx)
print(mxall)


### FIXED CODE ###

import collections

h, w = list(map(int, input().split()))
smat = [input() for _ in range(h)]

def bfs(x0, y0):
    visited = [[0 for _ in range(w)] for _ in range(h)]
    deq = collections.deque()
    deq.append((x0, y0, -1))

    mx = 0
    while len(deq) > 0:
        x, y, d = deq.popleft()
        nd = d + 1
        visited[x][y] = 1
        mx = max(mx, nd)

        for dx, dy in [(-1, 0), (0, -1), (+1, 0), (0, +1)]:
            nx = x + dx
            ny = y + dy
            if not (0 <= nx < h) or not (0 <= ny < w):
                # bound check
                continue
            if smat[nx][ny] == '#':
                # cell attr check
                continue
            if visited[nx][ny] == 1:
                # already visited
                continue
            v = (nx, ny, nd)
            deq.append(v)
    
    return mx

if all(all(col == '.' for col in row) for row in smat):
    print((w - 1) + (h - 1))
else:
    mxall = 0
    for x0 in range(h):
        for y0 in range(w):
            if smat[x0][y0] == '.':
                mx = bfs(x0, y0)
                mxall = max(mxall, mx)
    print(mxall)
### BUGGY CODE ###

n = int(input())
list=[]
count = 0

for i in range(n):
	
	str = input()
	if (not str in list):
		count += 1
		list.append(str)

print(count)

### FIXED CODE ###

import collections
n = int(input())
list=[]
count = 0

for i in range(n):
	
	str = input()
	list.append(str)

c = collections.Counter(list)
print(len(c))
### BUGGY CODE ###

from bisect import bisect_right as br
N = int(input())
A = [int(a) for a in input().split()]
B = [int(a) for a in input().split()]
s, t = 0, 0
for i in range(N):
    s ^= A[i]
    t ^= B[i]
ans = (s ^ t) * (N % 2)
for k in range(1, 29):
    m = (1<<k) - 1
    AA = sorted([a & m for a in A])
    BB = sorted([a & m for a in B])
    ans ^= (sum([N - br(AA, (1<<k) - b - 1) for b in BB]) % 2) << k

print(ans)

### FIXED CODE ###

from bisect import bisect_right as br
N = int(input())
A = [int(a) for a in input().split()]
B = [int(a) for a in input().split()]
s, t = 0, 0
for i in range(N):
    s ^= A[i]
    t ^= B[i]
ans = (s ^ t) * (N % 2)
for k in range(1, 29):
    m = (1<<k) - 1
    AA = sorted([a & m for a in A])
    BB = sorted([a & m for a in B])[::-1]
    m += 1
    i, j = 0, 0
    while i < N and AA[i] + BB[j] < m:
        i += 1
    s = 0
    while i < N:
        while j < N and AA[i] + BB[j] >= m:
            j += 1
        s += j
        i += 1
    ans ^= (s % 2) << k
print(ans)