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

import math

setwise = A[0]
for i in range(1,N):
    setwise = math.gcd(setwise,A[i])
    
PrimeFactorss = [[] for _ in range(M+1)]
for i in range(2, M+1):
    if len(PrimeFactorss[i]) == 0:
        for x in range(i, M+1, i):
            PrimeFactorss[x].append(i)

M = 10**6
num_list = [0]*(M+1)

for i in range(N):
    num_list[A[i]] += 1

pairwise = [0]*N

for i in range(N):
    for j in PrimeFactorss[A[i]]:
        for k in range(j,M+1,j):
            if num_list[k]==1:
                pairwise[i] += 1

if sum(pairwise) == N:
    print("pairwise coprime")
elif setwise == 1:
    print("setwise coprime")
else:
    print("not coprime")


### FIXED CODE ###

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

M = 10**6

import math

setwise = A[0]
for i in range(1,N):
    setwise = math.gcd(setwise,A[i])
    
PrimeFactorss = [[] for _ in range(M+1)]
for i in range(2, M+1):
    if len(PrimeFactorss[i]) == 0:
        for x in range(i, M+1, i):
            PrimeFactorss[x].append(i)
num_list = [0]*(M+1)

for i in range(N):
    num_list[A[i]] += 1

pairwise = [0]*(M+1)

n=M
primes = set(range(2, n+1))
for i in range(2, int(n**0.5+1)):
    primes.difference_update(range(i*2, n+1, i))
primes=list(primes)

for i in primes:
    for j in range(i,M+1,i):
        if num_list[j]==1:
            pairwise[i] += 1
        
ans = 0    
for i in pairwise:
    if i>1:
        ans += 1
        break
    
if setwise == 1 and ans == 0:
    print("pairwise coprime")
elif setwise == 1:
    print("setwise coprime")
else:
    print("not coprime")
from collections import defaultdict
import sys
input = sys.stdin.readline


n, m = map(int, input().split())
if m == 0:
    print('Yes')
    exit()
edges = defaultdict(list)

for i in range(m):
    left, right, dist = map(int, input().split())
    edges[left-1].append((right-1, dist))
    edges[right-1].append((left-1, -dist))

seen = [None] * n
for node in range(n):
    if seen[node] is not None:
        continue

    seen[node] = 0
    todo = []
    while edges[node]:
        to, dis = edges[node].pop()
		seen[to] = dis
        todo.append([to, dis])
        
    while todo:
        new, dis = todo.pop()

        while edges[new]:
            to, n_dis = edges[new].pop()
            if seen[to] is None:
                seen[to] = dis + n_dis
            elif seen[to] != dis + n_dis:
                print('No')
                exit()
            todo.append([to, dis + n_dis])

print('Yes')


### FIXED CODE ###

from collections import defaultdict
import sys
input = sys.stdin.readline
inf = float('INF')

n, m = map(int, input().split())
if m == 0:
    print('Yes')
    exit()
edges = defaultdict(list)

for i in range(m):
    left, right, dist = map(int, input().split())
    edges[left-1].append([right-1, dist])
    edges[right-1].append([left-1, -dist])

seen = [inf] * n
for node in range(n):
    if seen[node] != inf:
        continue

    seen[node] = 0
    todo = []
    while edges[node]:
        to, dis = edges[node].pop()
        todo.append([to, dis])
    while todo:
        new, dis = todo.pop()
        if seen[new] == inf:
            seen[new] = dis
        elif seen[new] != dis:
            print('No')
            exit()

        while edges[new]:
            to, n_dis = edges[new].pop()
            todo.append([to, dis + n_dis])

print('Yes')
R,G,B = map(int,input().split())
N = int(input())
count = 0
for r in range(R):
  for g in range(G):
    for b in range(B):
      if r*R+g*G+b*B == N:
        count += 1
      else:
        r += 1
print(count)

### FIXED CODE ###

R,G,B,N = map(int,input().split())
count = 0
 
for i in range(0,N+1,R):
    for j in range(0,N+1,G):
        sum = i + j
        if N - sum < 0:
            break
        elif (N - sum) % B == 0:
            count += 1
 
print(count)
row1=list(map(int,input().split()))
row2=list(map(int,input().split()))
row3=list(map(int,input().split()))
bingo=row1+row2+row3
num=int(input())
num_list=set()
for i in range(num):
  num_list.add(int(input()))

bingo_list=[[0,3,6],[1,4,7],[2,5,8],[0,1,2],[3,4,5],[6,7,8],[0,4,8],[2,4,6]]
num_list=list(num_list)
for i in num_list:
  if i in bingo:
    bingo[bingo.index(i)] = True

for i in bingo_list:
  if bingo[i[0]] is True and bingo[i[1]] is True and bingo[i[2]] is True:
    print('Yes')
    return 0

print('No')


### FIXED CODE ###

row1=list(map(int,input().split()))
row2=list(map(int,input().split()))
row3=list(map(int,input().split()))
bingo=row1+row2+row3
num=int(input())
num_list=set()
for i in range(num):
  num_list.add(int(input()))

bingo_list=[[0,3,6],[1,4,7],[2,5,8],[0,1,2],[3,4,5],[6,7,8],[0,4,8],[2,4,6]]
num_list=list(num_list)
for i in num_list:
  if i in bingo:
    bingo[bingo.index(i)] = True

for i in bingo_list:
  if bingo[i[0]] ==True and bingo[i[1]] == True and bingo[i[2]] == True:
    print('Yes')
    break
  if i == [2,4,6]:
    print('No')
n=int(input())

while n>=0:
  n=n-1 ##for tracking last character
  z+= chr( n%26 + ord('a') )
  n=n//26
print(z[::-1])
  

### FIXED CODE ###

n=int(input())
z=""
while n>0:
  n=n-1 ##for tracking last character
  z+= chr( n%26 + ord('a') )
  n=n//26
print(z[::-1])
n,m=list(map(int,input().split()))
par=[i for i in range(n)]
ro=dict(int)
for i in range(n):
    ro[i]=1
def root(i):
    if par[i]==i:
        return i
    else:
        return root(par[i])

def unite(x,y):
    rx=root(x)
    ry=root(y)
    if rx!=ry:
        par[rx]=ry
        ro[ry]+=ro[rx]
        ro[rx]=0

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


# for i in range(n):
#     ro[root(i)]+=1

print(max(ro.values()))

### FIXED CODE ###

d,t,s=list(map(int,input().split()))

if t*s>=d:
    print("Yes")
else:
    print("No")
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
X = A + B + C
N = int(input())
L = []
for i in range (N):
  K = int(input())
  L.append(K)
ck = 'No'
if A[1] in L and A[2]in L and A[3] in L:
  ck == 'Yes'
elif B[1] in L and B[2]in L and B[3] in L:
  ck == 'Yes'
elif C[1] in L and C[2]in L and C[3] in L:
  ck == 'Yes'
elif A[1] in L and B[1]in L and C[1] in L:
  ck == 'Yes'
elif A[2] in L and B[2]in L and C[2] in L:
  ck == 'Yes'
elif A[3] in L and B[3]in L and C[3] in L:
  ck == 'Yes'
elif A[1] in L and B[2] in L and C[3] in L:
  ck = 'Yes'
elif A[3] in L and B[2] in L and C[1] in L:
  ck = 'Yes'
print(ck)

### FIXED CODE ###

A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
X = A + B + C
N = int(input())
L = []
for i in range (N):
  K = int(input())
  L.append(K)
ck = 'No'
if A[0] in L and A[1]in L and A[2] in L:
  ck = 'Yes'
elif B[0] in L and B[1]in L and B[2] in L:
  ck = 'Yes'
elif C[0] in L and C[1]in L and C[2] in L:
  ck = 'Yes'
elif A[0] in L and B[0]in L and C[0] in L:
  ck = 'Yes'
elif A[1] in L and B[1]in L and C[1] in L:
  ck = 'Yes'
elif A[2] in L and B[2]in L and C[2] in L:
  ck = 'Yes'
elif A[0] in L and B[1] in L and C[2] in L:
  ck = 'Yes'
elif A[2] in L and B[1] in L and C[0] in L:
  ck = 'Yes'
print(ck)
n, w = map(int, input().split())
wv = [list(map(int, input().split())) for i in range(n)]
l = [0] * (n + 1)
for i in range(n + 1):
    l[i] = [0] * w
for i in range(1, n + 1):
    for j in range(w):
        if wv[i - 1][0] <= j:
            l[i][j] = max(l[i - 1][j], l[i - 1][j + 1 - wv[i - 1][0]] + wv[i - 1][1])
        else:
            l[i][j] = l[i - 1][j]
print(l[n][w - 1])


### FIXED CODE ###

n, w = map(int, input().split())
l1 = [list(map(int, input().split())) for i in range(n)]
v = 0
for i in range(n):
  v += l1[i][1]
d = [10 ** 9 + 1] * (v + 1)
d[0] = 0
for i in range(n):
    for j in range(v, -1, -1):
        d[j] = min(d[j], d[j - l1[i][1]] + l1[i][0])
answer = 0
for j in range(v + 1):
    if  w >= d[j]:
        answer = max(answer, j)
print(answer)
import sys
N, Y = map(int, input().split())
for a in range(N+1):
    for b in range(N+1):
        c = N - a - b
        if c < 0:
            continue
        if (10000*a + 5000*b + 1000*c) == Y:
            print(str(a)+" "+str(b)+" "+sstr(c))
            sys.exit()
print("-1 -1 -1")

### FIXED CODE ###

N, Y = map(int, input().split())
result = [-1, -1, -1]
for a in range(0, N+1):
    for b in range(0, N+1):
        c = N-a-b
        if c < 0:
            continue
        if Y == (10000*a + 5000*b + 1000*c):
            result[0] = a
            result[1] = b
            result[2] = c
print (" ".join(map(str, result)))
def counts(s, l, r):
    ans = s[l-1:r].count('AC')
    print(ans)

n, q = map(int, input().split())
s = input()
for i in xrange(q):
    l, r = map(int, input().split())
    counts(s, l, r)

### FIXED CODE ###

import sys
input = sys.stdin.readline

n, q = map(int, input().split())
s = input()
memo = [0] * n
cnt = 0

for i in range(1, n):
    if s[i - 1] == 'A' and s[i] == 'C':
        cnt += 1
    memo[i] = cnt

for i in range(q):
    l, r = map(int, input().split())
    print(memo[r - 1] - memo[l - 1])
import bisect
a,b,c = map(int,input().split())

aa = []
bb = []
for i in range(a):
	aa.append(int(input()))
for i in range(b):
	bb.append(int(input()))
for i in range(c):
	cc = int(input())
	aaa = bisect.bisect_left(aa,cc)
	bbb = bisect.bisect_left(bb,cc)
	if aaa == 0 and bbb == 0:
		print(max(aa[0],bb[0]) - cc)
	elif aaa == a and bbb == b:
		print(cc - min(aa[a-1],bb[b-1]))
	elif aaa == 0:
		if bbb == b:
			print(min(abs(cc - aa[0]),abs(cc - bb[bbb-1])) + aa[0] - bb[bbb-1])
		else:
			aaaa = min(abs(bb[bbb] - aa[0])min(abs(cc-aa[0]),abs(cc-bb[bbb])),abs(bb[bbb-1] - aa[0])min(abs(cc-aa[a-1]),abs(cc-bb[bbb-1])))
			print(aaaa)
	elif bbb == 0:
		if aaa == a:
			print(min(abs(cc - aa[0]),abs(cc - bb[bbb-1])) + bb[0] - aa[aaa-1])
		else:
			bbbb = min(abs(bb[0] - aa[aaa-1])+min(abs(cc-aa[aaa-1]),abs(cc-bb[0])),abs(bb[0] - aa[aaa])+min(abs(cc-aa[aaa]),abs(cc-bb[0])))
			print(bbbb)
	elif aaa == a:
		aaaa = min(abs(bb[bbb] - aa[a-1])+min(abs(cc-aa[a-1]),abs(cc-bb[bbb])),abs(bb[bbb-1] - aa[a-1])+min(abs(cc-aa[a-1]),abs(cc-bb[bbb-1])))
		print(aaaa)
	elif bbb == b:
		bbbb = min(abs(bb[b-1] - aa[aaa-1])+min(abs(cc-aa[aaa-1]),abs(cc-bb[b-1])),abs(bb[b-1] - aa[aaa])+min(abs(cc-aa[aaa]),abs(cc-bb[b-1])))
		print(bbbb)
	else:
		aaaa = min(max(aa[aaa],bb[bbb])-cc,cc-min(aa[aaa-1],bb[bbb-1]),2*aa[aaa] - cc - bb[bbb-1],aa[aaa] + cc - 2 * bb[bbb-1])
		print(aaaa)

### FIXED CODE ###

import bisect
a,b,c = map(int,input().split())

aa = []
bb = []
for i in range(a):
	aa.append(int(input()))
for i in range(b):
	bb.append(int(input()))
for i in range(c):
	cc = int(input())
	aaa = bisect.bisect_left(aa,cc)
	bbb = bisect.bisect_left(bb,cc)
	if aaa == 0 and bbb == 0:
		print(max(aa[0],bb[0]) - cc)
	elif aaa == a and bbb == b:
		print(cc - min(aa[a-1],bb[b-1]))
	elif aaa == 0:
		if bbb == b:
			print(min(abs(cc - aa[0]),abs(cc - bb[bbb-1])) + aa[0] - bb[bbb-1])
		else:
			aaaa = min(abs(bb[bbb] - aa[0])+min(abs(cc-aa[0]),abs(cc-bb[bbb])),abs(bb[bbb-1] - aa[0])+min(abs(cc-aa[aaa]),abs(cc-bb[bbb-1])))
			print(aaaa)
	elif bbb == 0:
		if aaa == a:
			print(min(abs(cc - aa[a-1]),abs(cc - bb[0])) + bb[0] - aa[aaa-1])
		else:
			bbbb = min(abs(bb[0] - aa[aaa-1])+min(abs(cc-aa[aaa-1]),abs(cc-bb[0])),abs(bb[0] - aa[aaa])+min(abs(cc-aa[aaa]),abs(cc-bb[0])))
			print(bbbb)
	elif aaa == a:
		aaaa = min(abs(bb[bbb] - aa[a-1])+min(abs(cc-aa[a-1]),abs(cc-bb[bbb])),abs(bb[bbb-1] - aa[a-1])+min(abs(cc-aa[a-1]),abs(cc-bb[bbb-1])))
		print(aaaa)
	elif bbb == b:
		bbbb = min(abs(bb[b-1] - aa[aaa-1])+min(abs(cc-aa[aaa-1]),abs(cc-bb[b-1])),abs(bb[b-1] - aa[aaa])+min(abs(cc-aa[aaa]),abs(cc-bb[b-1])))
		print(bbbb)
	else:
		aaaa = min(max(aa[aaa],bb[bbb])-cc,cc-min(aa[aaa-1],bb[bbb-1]),2*aa[aaa] - cc - bb[bbb-1],aa[aaa] + cc - 2 * bb[bbb-1],2*bb[bbb] - cc - aa[aaa-1],bb[bbb] + cc - 2 * aa[aaa-1])
		print(aaaa)
import math
from functools import reduce

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

B = []
for i in range(N):
    B.append(abs(X- A[i]))

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(max(min(B),gcd_list(B)))

### FIXED CODE ###

#import math
import fractions
from functools import reduce

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

B = []
for i in range(N):
    B.append(abs(X- A[i]))

#最大公約数    
def gcd_list(numbers):
    #return reduce(math.gcd, numbers)
    return reduce(fractions.gcd, numbers)

print(gcd_list(B))
import math

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


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


def cantdiv(x):
    return x - math.floor(x / c) - math.floor(x / d) + math.floor(x / lcm(c, d))


print(cantdiv(b) - cantdiv(a - 1))


### FIXED CODE ###

from fractions import gcd

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


def lcm(x, y):
    if gcd(x, y) == 0:
        return x * y
    return x * y // gcd(x, y)


def cantdiv(x):
    return x - x // c - x // d + x // lcm(c, d)


print(cantdiv(b) - cantdiv(a - 1))
s = input()
st = 'abcdefghijklmnopqrstuvwxyz'
print(st[index(s)+1])

### FIXED CODE ###

s = input()
st = 'abcdefghijklmnopqrstuvwxyz'
print(st[st.index(s)+1])
a,b=map(int,input().split())

for i in range(50):
    if a>=2**i and a<2**(i+1):
        A=i+1
    if b>=2**i and b<2**(i+1):
        B=i+1

N=[0]*B

for i in range(a,2**A):
    X=format(i,'b')
    for j in range(-1,-A-1,-1):
        N[j]+=int(X[j])
    
for i in range(2**(B-1),b+1):
    Y=format(i,'b')
    for j in range(B):
        N[j]+=int(Y[j])
ans=0
for i in range(B):
    if N[i]%2==1:
        ans+=2**(B-i-1)
print(ans)

### FIXED CODE ###

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

if a%2==0:
    fa=(a//2)%2
else:
    fa=(((a-1)//2)%2)^(a-1)

if b%2==0:
    fb=((b//2)%2)^b
else:
    fb=((b+1)//2)%2
    
print(fb^fa)
h, w, k = map(int, input().split())
s = [input() for _ in range(h)]

t = [[0] * w for _ in range(h)]
n = 0
rows = []
for i in range(h):
    if s[i].count("#") == 0:
        rows.append(i)
    else:
        if s[i][0] == "#":
            for j in range(w):
                if s[i][j] == "#":
                    n += 1
                t[i][j] = n
        else:
            n += 1
            f = 0
            for j in range(w):
                if f and s[i][j] == "#":
                    n += 1
                elif s[i][j] == "#":
                    f = 1
                t[i][j] = n

if rows[-1] == h-1:
    for k in range(h)[::-1]:
        if t[k][j] != 0:
            for j in range(w):
                t[rows[-1]][j] = t[k][j]
            break
        
for i in rows:
    for k in range(i+1, h):
        if t[k][j] != 0:
            for j in range(w):
                t[i][j] = t[k][j]
            break

for i in range(h):
    print(*t[i])

### FIXED CODE ###

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

t = [[0] * w for _ in range(h)]
n = 0
rows = []
for i in range(h):
    if s[i].count("#") == 0:
        rows.append(i)
    else:
        if s[i][0] == "#":
            for j in range(w):
                if s[i][j] == "#":
                    n += 1
                t[i][j] = n
        else:
            n += 1
            f = 0
            for j in range(w):
                if f and s[i][j] == "#":
                    n += 1
                elif s[i][j] == "#":
                    f = 1
                t[i][j] = n

if rows != [] and rows[-1] == h-1:
    for k in range(h)[::-1]:
        if t[k][j] != 0:
            for j in range(w):
                t[rows[-1]][j] = t[k][j]
            break
        
for i in rows:
    for k in range(i+1, h):
        if t[k][j] != 0:
            for j in range(w):
                t[i][j] = t[k][j]
            break

for i in range(h):
    print(*t[i])
n,m=map(int,input().split())
ans=1
for i in range(1,int(m**(1/2))+1):
    if m%i==0:
        if i>=n:ans=max(m//i*,ans)
        if m//i>=n:
            ans=max(i,ans)
print(ans)

### FIXED CODE ###

n,m=map(int,input().split())
ans=1
ps=[]
for i in range(1,int(m**(1/2))+1):
    if m%i:continue
    if n*(i)<=m:ans=max(i,ans)
    if n*(m//i)<=m:ans=max(ans,m//i)
print(ans)
a,b,c,d,e,k= map(int,input().split())
if e-a>k:print(':(')
else:print('Yay!')

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if e-a>k:print(':(')
else:print('Yay!')
S = raw_input()
S = int(S)
h = second / 3600
m = (second - time * 3600) / 60
s = second % 60
print h , m , s

### FIXED CODE ###

S = raw_input()
S = int(S)
h = S / 3600
m = (S - h * 3600) / 60
s = S - 3600 * h - 60 * m

print "%d:%d:%d" % (h,m,s)
def main():
    H,W,K = map(int,input().split())
    S = [[int(s) for s in input()]for _ in range(H)]
    ans = 2**60
    for i in range(2**(H-1)):
        aa = 0
        for j in range(H-1):
            if (i>>j)&1 == 1:
                aa+=1
        c = aa
        b = [0]*(c+1)
        OK = True
        for j in range(W):
            k = 0
            for h in range(H):
                if S[h][j] == 1:b[k] += 1
                if (i>>j)&1==1:k+=1
            
            ok = True
            for p in b:
                if p > K:ok = False
            if not ok:
                aa += 1
                b = [0]*(c+1)
                k = 0
                for h in range(H):
                    if S[h][j]==1:b[k] += 1
                    if (i>>j)&1==1:k+=1
                ok = True
                for p in b:
                    if p > K:ok = False
                if not ok:OK = False;break                
        if OK:ans = min(ans,aa)
    print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    H,W,K = map(int,input().split())
    S = [input()for _ in range(H)]
    ans = 10**9
    for i in range(2**(H-1)):
        aa = 0
        for j in range(H-1):
            if (i>>j)&1 == 1:
                aa+=1
        c = aa
        b = [0]*(c+1)
        OK = True
        for j in range(W):
            k = 0
            for h in range(H):
                if S[h][j] == "1":b[k] += 1
                if (i>>h)&1==1:k+=1
            
            ok = True
            for p in b:
                if p > K:ok = False
            if not ok:
                aa += 1
                b = [0]*(c+1)
                
                k = 0
                for h in range(H):
                    if S[h][j]=="1":b[k] += 1
                    if (i>>h)&1==1:k+=1
                ok = True
                for p in b:
                    if p > K:ok = False
                if not ok:OK = False;break                
        if OK:ans = min(ans,aa)
    print(ans)

if __name__ == "__main__":
    main()
def calc(s):
    t=s.split()
    a=int(t[0])
    b=int(t[2])
    op=t[1]
    if op=="+":
        return ("{0}".format(a+b))
    if op == "-":
        return ("{0}".format(a - b))
    if op == "*":
        return ("{0}".format(a * b))
    if op == "/":
        return ("{0}".format(a // b))
w="yjsnpi"
a=[]
while(w!="0 ? 0"):
    w=input()
    a.append(w)
a.remove("0 ? 0")
for st in a:
    print("{0}".format(calc(st)))

### FIXED CODE ###

def calc(s):
    t=s.split()
    a=int(t[0])
    b=int(t[2])
    op=t[1]
    if op=="+":
        return ("{0}".format(a+b))
    if op == "-":
        return ("{0}".format(a - b))
    if op == "*":
        return ("{0}".format(a * b))
    if op == "/":
        return ("{0}".format(a // b))
w="yj s npi"
a=[]
while(w.split()[1]!="?"):
    w=input()
    a.append(w)
a.pop()
for st in a:
    print("{0}".format(calc(st)))
s = list(open(0))
s = input()

j = [0]*int(s)

a = list(map(int,input().split()))
for i in  range(int(s)-1):
    j[a[i]] += 1
for i in range(len(j)-1):
    print(j[(i+1)])

print(0)

### FIXED CODE ###

s = input()

j = [0]*int(s)

a = list(map(int,input().split()))
for i in  range(int(s)-1):
    j[a[i]] += 1
for i in range(len(j)-1):
    print(j[(i+1)])

print(0)
l = [int(i) for i in input().split()]

for i in range(l[0]+1):
  r = (i * 2 + (l[0] - i) * 4
  if r == l[1]:
    print("Yes")
    break
  else:
    if i == l[0]:
      print("No")

### FIXED CODE ###

l = [int(i) for i in input().split()]

for i in range(l[0]+1):
  r = i * 2 + (l[0] - i) * 4
  if r == l[1]:
    print("Yes")
    break
  else:
    if (l[0] - i) == 0:
      print("No")
while True:
    try:
        l = []
        for i in range(8):
            l += list(map(int, input()))
    except:
        break

    cnt = 0
    for i in range(len(l)):
        if l[i]:
            cnt += i
    cnt -= l.index(1) * 4

    if cnt == 18:
        ans = "A"
    elif cnt == 48:
        ans = "B"
    elif cnt == 6:
        ans = "C"
    elif cnt == 34:
        ans = "D"
    elif cnt == 20:
        ans = "E"
    elif cnt == 34:
        ans = "F"
    else:
        ans = "G"

    print(ans)



### FIXED CODE ###

ans = {"1100000011": "A", "1000000010000000100000001": "B",
       "1111": "C", "1000000110000001": "D",
       "11000000011": "E", "100000001100000001": "F", "110000011": "G"}
while True:
    try:
        st = "".join([input() for _ in range(8)])

        st = st[st.find("1"): st.rfind("1")+1]
        for k, v in ans.items():
            if st == k:
                print(v)
                break
        input()
    except:
        break
import heapq
INFTY = 10**6
N,u,v = map(int,input().split())
G = {i:[] for i in range(1,N+1)}
for _ in range(N-1):
    a,b = map(int,input().split())
    G[a].append(b)
    G[b].append(a)
dist1 = [INFTY for _ in range(N+1)]
hist = [0 for _ in range(N+1)]
heap = [(0,u)]
dist1[u] = 0
hist[u] = 1
while heap:
    d,x = heapq.heappop(heap)
    if d>dist1[x]:continue
    hist[x]=1
    for y in G[x]:
        if hist[y]==0 and dist1[y]>d+1:
            dist1[y] = d+1
            heapq.heappush((d+1,y))
dist2 = [INFTY for _ in range(N+1)]
hist = [0 for _ in range(N+1)]
heap = [(0,v)]
dist2[v] = 0
hist[v] = 1
while heap:
    d,x = heapq.heappop(heap)
    if d>dist2[x]:continue
    hist[x]=1
    for y in G[x]:
        if hist[y]==0 and dist2[y]>d+1:
            dist2[y] = d+1
            heapq.heappush((d+1,y))
cmax = 0
for i in range(1,N+1):
    if dist1[i]<dist2[i]:
        cmax = max(cmax,dist2[i])
print(cmax-1)

### FIXED CODE ###

from collections import deque
INFTY = 10**6
N,u,v = map(int,input().split())
G = {i:[] for i in range(1,N+1)}
for _ in range(N-1):
    a,b = map(int,input().split())
    G[a].append(b)
    G[b].append(a)
du = [INFTY for _ in range(N+1)]
du[u] = 0
que = deque([(0,u)])
hist = [0 for _ in range(N+1)]
hist[u] = 1
while que:
    c,i = que.popleft()
    for j in G[i]:
        if hist[j]==0:
            que.append((c+1,j))
            du[j] = c+1
            hist[j] = 1
dv = [INFTY for _ in range(N+1)]
dv[v] = 0
que = deque([(0,v)])
hist = [0 for _ in range(N+1)]
hist[v] = 1
while que:
    c,i = que.popleft()
    for j in G[i]:
        if hist[j]==0:
            que.append((c+1,j))
            dv[j] = c+1
            hist[j] = 1
cmax = 0
for i in range(1,N+1):
    if du[i]<dv[i]:
        cmax = max(cmax,dv[i])
print(cmax-1)
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	n=int(raw_input())
	if n<0:break
	e=0
	#for i in range(n):
	#	a=ref[int(raw_input())]
	#	print "{:07b}".format(a^e)
	#	e=a

### FIXED CODE ###

ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass
total = 0
for i in map(int, input().split()):
    if i == 1:
        total=total+300000
    elif i == 2:
        total=total+200000
    elif i == 3:
        total=total+100000
if total==600000:
    total=1000000
print(total)

### FIXED CODE ###

s = 0
for i in map(int, input().split()):
    if i == 1:
        s+=300000
    elif i ==2 :
        s+= 200000
    elif i ==3 :
        s+= 100000
if s== 600000:
    s = 1000000
print(s)
a,b,c=map(int,input().split())
print("Yes" if a == b and a == c "No")

### FIXED CODE ###

a,b,c=map(int,input().split())
print("Yes" if a == b and a == c else "No")
ans=1
N=int(input())
c=int((N-1)/2)
for i in range(c):
	for j in range(c):
    	cnt=i+j
        if cnt=N:
        	ans+=1
print(ans)

### FIXED CODE ###

N=int(input())
c=-(-N//2)-1
print(c)