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

for i in range(N-1,0,-1):
    A[i] = sum(A[i::i+1]) % 2

s = sum(A[0:N])
print(s)

n = 1
for i in range(N):
    if s == 0:
        print('')
        break
    if A[i] == 1:
        if n == s:
            print(i+1)
            break
        else:
            print(i+1,end=' ')
            n += 1


### FIXED CODE ###

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

for i in range(N-1,-1,-1):
    A[i] = sum(A[i::i+1]) % 2

s = sum(A[0:N])
print(s)

n = 1
for i in range(N):
    if A[i] == 1:
        if n == s:
            print(i+1)
            break
        else:
            print(i+1,end=' ')
            n += 1
N=int(input())
A=list(int, input().split())
counter=[]
for num in range(N):
  counter.append(0)
for num in range(N):
  while A[num]%2=0:
    A[num]=A[num]/2
    counter[num]+=1
print(sum(counter))
  

### FIXED CODE ###

N=int(input())
A=list(map(int, input().split()))
counter=[]
for num in range(len(A)):
  counter.append(0)
for num in range(len(A)):
  while A[num]%2==0:
    A[num]=A[num]/2
    counter[num]+=1
print(sum(counter))
n = int(input())

print (n+1)*n/2

### FIXED CODE ###

x = int(input())
 
print(int((x+1)*x/2))
if __name__ == '__main__':
    d = input()
    n = int(input())
    for _ in range(n):
        q = input()
        d = d[::-1] if q[0] == ('1') else d = q[-1]+d if q[:3] == ("2 1") else d=d+q[-1]      
    print(d)

### FIXED CODE ###

if __name__ == '__main__':
    d = input()
    n = int(input())
    qs = [input() for e in range(n)]
    s = []
    e = []
    r = False
    for q in qs:
        if q == '1':
            r = not(r)
        elif q.startswith("2 1"):
            e.append(q[-1]) if r else s.append(q[-1])
        else:
            s.append(q[-1]) if r else e.append(q[-1])
    print("".join(e[::-1]) + d[::-1] + "".join(s) if r else "".join(s[::-1]) + d + "".join(e))
# -*- coding: utf-8 -*-
n=raw_input().
ina=int(n)
des=0
for x in range(26):
    for y in range(16):
        ans=4*x+7*y
        if ans==ina:
            des=des+1
if des>0:
    print "Yes"
else:
    print"No"


### FIXED CODE ###

# -*- coding: utf-8 -*-
n=raw_input()
ina=int(n)
des=0
for x in range(26):
    for y in range(16):
        ans=4*x+7*y
        if ans==ina:
            des=des+1
if des>0:
    print "Yes"
else:
    print"No"
n, k = map(int, input().split())

li = [0]
li.extend(list(map(int, input().split())))

def search(town, times):
  if times == 0:
    return town
  else:
    nextTown = li[town]
    return search(nextTown, times-1)

tuita = [0]*(n+1)
cnt = 0
town = 1

while True:
  town = li[town]
  cnt += 1
  if tuita[town] == 0:
    tuita[town] = cnt
  else:
    if k < tuita[town]:
      print(search(1, k))
    elif k == tuita[town]:
      print(town)
    else:
      print("a")
      break
      print(search(town, (k - tuita[town]) % (cnt - tuita[town])))
    break
 

### FIXED CODE ###

n, k = map(int, input().split())

li = [0]
li.extend(list(map(int, input().split())))
tuita = [0]*(n+1)
cnt = 0
town = 1

lastTown = 1
while True:
  town = li[town]
  cnt += 1
  if tuita[town] == 0:
    tuita[town] = cnt
  else:
    if k < tuita[town]:
      lastTown = 1
      times = k
    elif k == tuita[town]:
      lastTown = town
      times = 0
    else:
      lastTown = town
      times = (k - tuita[town]) % (cnt - tuita[town])
    break

town = lastTown
while times > 0:
  if times <= 0:
    break
  times -= 1
  town = li[town]
print(town)
s=input()
if s="AAA"or s="AAB"or s="ABA"or s="ABB"or s="BBA"or s="BAB"or s="BBA":
    print("Yes")
else:
    print("No")

### FIXED CODE ###

S=set(input())

if len(S)==1:
    print("No")
else:
    print("Yes")
# -*- coding: utf-8 -*-
a = int(input())
b = list(int(input().split("")))
count = list()
for i in range(a):
  count[i-1] = 0
  while b[i-1] % 2 == 0:
    b[i-1] = b[i-1] / 2
    count[i-1] += 1
print(min(count))

### FIXED CODE ###

# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))
count = []
for i in range(n):
    count.append(0)
    while a[i] % 2 == 0:
        a[i] = a[i] / 2
        count[i] += 1
print(min(count))
from scipy.special import comb

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

C = comb(N*M-2, K-2)
print(int(C))

A = int(0)
for d in range(N):
    a = (N-d)*(M**2)

    A += int(d*a)

B = int(0)
for d in range(M):
    b = (M-d)*(N**2)
    B += int(d*b)

ans = int((A+B)*C)
print(ans)

### FIXED CODE ###

def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

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

C = comb(N*M-2, K-2)
#print(int(C))

A = int(0)
for d in range(N):
    a = (N-d)*(M**2)

    A += int(d*a)

B = int(0)
for d in range(M):
    b = (M-d)*(N**2)
    B += int(d*b)

ans = int((A+B)*C)
ans = ans%(1000000007)
print(ans)
s = input()
if (s = "SSS"):
  print("0")
elif (s = "SSR"):
  print("1")
elif (s = "SRS"):
  print("1")
elif (s = "RSS"):
  print("1")
elif (s = "SRR"):
  print("2")
elif (s = "RSR"):
  print("1")
elif (s = "RRS"):
  print("2")
else:
  print("3")
  

### FIXED CODE ###

s = input()
if (s == "SSS"):
  print("0")
elif (s == "SSR"):
  print("1")
elif (s == "SRS"):
  print("1")
elif (s == "RSS"):
  print("1")
elif (s == "SRR"):
  print("2")
elif (s == "RSR"):
  print("1")
elif (s == "RRS"):
  print("2")
else:
  print("3")
X,Y,Z = intput().split()

print(Z,X,Y)

### FIXED CODE ###

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

print(Z, X, Y)
while True:
    (n, x) = [int(i) for i in input().split()]
    if n == x == 0:
        break
    print([1 if sum(i) == x else 0 for i in input.combinations(range(1, n + 1), 3)])

### FIXED CODE ###

while True:
    n, x = [int(i) for i in input().split()]

    if n == x == 0:
        break

    count = 0
    for s in range(1, n - 1):
        for m in range(s + 1, n):
            for e in range(m + 1, n + 1):
                if x == sum([s, m, e]):
                    count += 1

    print(count)
n=map(int,input())
s=list(map(str,input()))

count=0
for i in range(n-2):
    if s[i]=="A":
        if s[i+1]=="B":
            if s[i+2]=="C":
                count+=1

print(count)

### FIXED CODE ###

n=int(input())
s=str(input())

count=0
for i in range(n-2):
    if s[i]=="A":
        if s[i+1]=="B":
            if s[i+2]=="C":
                count+=1

print(count)
=int(input())
b=int(input())
h=int(input())

s=(a+b)*h/2

print(int(s))

### FIXED CODE ###

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

s=(a+b)*h/2
print(int(s))
_in = list(open(0))
h, w = list(map(int, _in[0].split()))

s = []
for i, y in enumerate(_in[1:]):
    for j, x in enumerate(y):
        if x == '#':
            s.append((i+1,j+1))

a = [[False]*(w+2)]
a += [[False] + [True]*w + [False] for _ in range(h)]
a += [[False]*(w+2)]
display(a)

ans = 0
while True:
    ns = []
    for i, j in s:
        a[i][j] = False

        if a[i-1][j]:
            ns.append((i-1, j))
        if a[i+1][j]:
            ns.append((i+1, j))
        if a[i][j-1]:
            ns.append((i, j-1))
        if a[i][j+1]:
            ns.append((i, j+1))
        
    if not ns:
        break
    s = ns
    ans += 1
    
print(ans)

### FIXED CODE ###

def main():
    H, W = map(int, input().split())
    m = []
    m.append([True] * (W + 2))
    for _ in range(H):
        m.append([True] + [c == '#' for c in input()] + [True])
    m.append([True] * (W + 2))
    queue = []
    for i in range(1, H + 1):
        for j in range(1, W + 1):
            if m[i][j]:
                queue.append((i, j))
    ans = -1
    while queue:
        ans += 1
        tmp = []
        for x, y in queue:
            if not m[x - 1][y]:
                m[x - 1][y] = True
                tmp.append((x - 1, y))
            if not m[x + 1][y]:
                m[x + 1][y] = True
                tmp.append((x + 1, y))
            if not m[x][y - 1]:
                m[x][y - 1] = True
                tmp.append((x, y - 1))
            if not m[x][y + 1]:
                m[x][y + 1] = True
                tmp.append((x, y + 1))
        queue = tmp
    print(ans)

if __name__ == '__main__':
    main()
n=int(input())
for i in 10**9:
  if n%2==0 and n%i==0:
    print(i)
    exit()

### FIXED CODE ###

n=int(input())
if(n%2==0):
  print(n)
else:
  print(n*2)
a , b = map(int,input().split())

print((a*b)//1)

### FIXED CODE ###


import decimal

x = list(input().split())
 
a = int(x[0])
 
b = decimal.Decimal(x[1])
 
print(int(a*b))
from collections import deque, defaultdict

N, M = map(int, input().split())
edge = defaultdict(list)
for i in range(M):
    a, b = map(int, input().split())
    edge[(a, 0)].append((b, 1))
    edge[(a, 1)].append((b, 2))
    edge[(a, 2)].append((b, 0))

S, T = map(int, input().split())

def BST(now, goal, visited):
    count = 0
    for node in edge[now]:
        if(node == goal):
            return 1
        elif(not node in visited):
            visited.appendleft(node)
            temp = BST(node, goal, visited)
            if(temp == False):
                continue
            temp += 1
            visited.pop()
            if(count == 0):
                count = temp
            elif(temp < count):
                count = temp
    if(count == 0):
        return False
    else:
        return count

visited = deque()
ret = BST((S, 0), (T, 0), visited)
if(ret == False):
    print(-1)
else:
    print(ret//3)


### FIXED CODE ###

from collections import deque, defaultdict

N, M = map(int, input().split())
edge = defaultdict(list)
for i in range(M):
    a, b = map(int, input().split())
    edge[(a, 0)].append((b, 1))
    edge[(a, 1)].append((b, 2))
    edge[(a, 2)].append((b, 0))

S, T = map(int, input().split())

inf = float('inf')
dist = {}
for i in range(1, N+1):
    dist[(i, 0)] = inf
    dist[(i, 1)] = inf
    dist[(i, 2)] = inf
dist[(S, 0)] = 0

dq = deque()
dq.append((S, 0))

while dq:
    v = dq.popleft()
    if v == (T, 0):
        break
    for u in edge[v]:
        if dist[u] < inf: continue
        dq.append(u)
        dist[u] = dist[v] + 1

if(dist[(T, 0)] == inf):
    print(-1)
else:
    print(dist[(T, 0)]//3)
import math
S = int(input())
X1 = 0
Y1 = 0
X2 = 0
Y2 = 0
X3 = 0
Y3 = 0
if  S <= 10 ** 9:
    X2 = S
    Y3 = 1
else:
    X2 = int(math.sqrt(S)+0.00001)
    Y3 = X2
    s = X2 ** 2  - S #残りの面積
    for i in range(1, int(math.sqrt(s) + 1)):
        if s%i == 0 and s%i <= 10 ** 9 and i <= 10 ** 9:
                X3 = i
                Y2 = s
                break


print (X1, Y1, X2, Y2, X3, Y3)


### FIXED CODE ###

import math
S = int(input())
X1 = 0
Y1 = 0
X2 = 0
Y2 = 0
X3 = 0
Y3 = 0
if  S <= 10 ** 9:
    X2 = S
    Y3 = 1
elif S == 1000000000000000000:
    X2 = int(math.sqrt(S))
    Y3 = X2
else:
    X2 = int(math.sqrt(S) + 1)
    Y3 = X2
    s = X2 ** 2  - S #残りの面積
    for i in range(1, int(math.sqrt(s) + 1)):
        if s%i == 0 and s//i <= 10 ** 9 and i <= 10 ** 9:
            X3 = i
            Y2 = s//i
            break

print (X1, Y1, X2, Y2, X3, Y3)
N = int(input())
A = list(map(int,input().split()))

A.sort()
stack = A[1:]
m = A[0]

while stack:
  stack = list(stack)
  l = []
  for x in stack:
    if x % m == 0:
      continue
    l.append(x % m)
  
  m = min(l)
  stack = set(l)

print(m)






### FIXED CODE ###

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

A.sort()
stack = A[1:]
m = A[0]

while stack:
  stack = list(stack)
  l = []
  for x in stack:
    if x % m == 0:
      continue
    l.append(x % m)
  
  if not l:
    break
  l.append(m)
  m = min(l)
  stack = set(l)

print(m)
import sys
N = input()
a = list(map(int, input().split()))

if 0 in a:
    print(0)
    sys.exit()

b=1
for i in range(0,N):
    b *= a[i]
    if b > 1000000000000000000:
        print(-1)
        sys.exit

print(b)

### FIXED CODE ###

import sys
N = int(input())
a = list(map(int, input().split()))

if 0 in a:
    print(0)
    sys.exit()

b=1
for i in range(0,N):
    b *= a[i]
    if b > 1000000000000000000:
        print(-1)
        sys.exit()

print(b)
A, B, C = map(str, input().split())
print(A.upper[0]+B.upper[0]+C.upper[0])

### FIXED CODE ###

A, B, C = map(str, input().split())
print((A[0]+B[0]+C[0]).upper())
def search(x, num):
    nodes.remove(x)
    for y in edge[x]:
        edge[y].discard(x)
    for y in list(edge[x]):
        if y in nodes:
            num = search(y, num)
    return num + 1

(n,m),*d  = [list(map(int, s.split())) for s in open(0)]

edge = {}
for x in d:
    if x[0] in edge:
        edge[x[0]].add(x[1])
    else:
        edge[x[0]] = {x[1]}
    if x[1] in edge:
        edge[x[1]].add(x[0])
    else:
        edge[x[1]] = {x[0]}

nodes = set(range(1,n+1))
ans = 1
for x in list(nodes):
    if x in nodes:
        ans = max(ans, search(x, 0))
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(int(1e6))

def search(x, num):
    nodes.remove(x)
#     for y in edge[x]:
#         edge[y].discard(x)
#     for y in list(edge[x]):
    for y in edge[x]:
        if y in nodes:
            num = search(y, num)
    return num + 1

(n,m),*d  = [list(map(int, s.split())) for s in open(0)]

edge = [set() for _ in range(n+1)]
for x in d:
    edge[x[0]].add(x[1])
    edge[x[1]].add(x[0])

nodes = set(range(1,n+1))
ans = 1
for x in list(nodes):
    if x in nodes:
        ans = max(ans, search(x, 0))
print(ans)
import math
S = input()
Q = int(input())

def reverse_list(S):
    if len(S) == 1:
        return S
    else:
        return S[::-1]

def moji_tuika(S, f, c):
    if f == 1:
        return c + S
    else:
        return S + c

q = []
for i in range(Q):
    temp = input().split()
    if len(temp) == 1:
        q.append(1)
    else:
        t = int(temp[0])
        f = int(temp[1])
        c = temp[2]
        q.append((t,f,c))

for i in q:
    if type(i) == int:
        S = reverse_list(S)
    elif i[0] == 2:
        S = moji_tuika(S,i[1],i[2])

print(S)


### FIXED CODE ###

S = input()

if S.count('A') > 0 and S.count('B') > 0:
    print('Yes')
else:
    print('No')
lst = list(map(int, input().split()))
N = lst.pop(3)
lst.sort(reverse=True)
R,G,B = lst
sum = 0
for i in range(int(N / R) + 1):
  for j in range(int((N - (i * R)) / G) + 1):
    for k in range(int((N - (i * R) - (j * G)) / B) + 1):
      ans = i * R + j * G + k * B
      if (ans == N):
        sum += 1
print(sum)

### FIXED CODE ###

N, K = map(int, input().split())
print(N-K+1)
import itertools
import sys
import math
import numpy as np
import fractions
from collections import deque
from itertools import combinations
from functools import reduce
from functools import lru_cache
sys.setrecursionlimit(10**9)

def get_lcm(num):
    return reduce(lambda x,y:(x * y) // fractions.gcd(x, y), num, 1)

def main():
    N,M = map(int,input().split())
    half_A = list(map(lambda x:int(x)//2,input().split()))

    lcm = get_lcm(half_A)

    if lcm <= M:
        if reduce(lambda x, y: (lcm // x) % 2 == 1 and (lcm // y) % 2 == 1, half_A):
            print(math.ceil(M/(2*lcm)))
            exit()

    print(0)


if __name__ == "__main__":
  main()


### FIXED CODE ###

import itertools
import sys
import math
import numpy as np
import fractions
from collections import deque
from itertools import combinations
from functools import reduce
from functools import lru_cache
sys.setrecursionlimit(10**9)

def get_lcm(num):
    return reduce(lambda x,y:(x * y) // fractions.gcd(x, y), num, 1)

def main():
    N,M = map(int,input().split())
    half_A = list(map(lambda x:int(x)//2,input().split()))

    lcm = get_lcm(half_A)

    if lcm > M:
        print(0)
        exit()

    for a in half_A:
        if (lcm // a) % 2 == 0:
            print(0)
            exit()

    # print(math.ceil(M/(2*lcm)))
    print((M//lcm + 1) // 2)


if __name__ == "__main__":
  main()
N, M = map(int,input().split())
P_Y_list = np.array([input().split() for _ in range(0, M)], dtype='int')
years = [np.sort(P_Y_list[np.where(P_Y_list[:,0]==i)][:,1]) for i in set(P_Y_list[:, 0])]
for l in P_Y_list:
    left = str(l[0]).zfill(6)
    right = str(np.where(years[list(set(P_Y_list[:,0])).index(l[0])]==l[1])[0][0]+1).zfill(6)
    print(left+right)

### FIXED CODE ###

import numpy as np
N, M = map(int,input().split())
P_Y_list = np.array([input().split() for _ in range(0, M)], dtype='int')
counts = (np.zeros(N+1)).astype(int)
id_list = []

sort_ind = np.argsort(P_Y_list[:,1])
sorted_P_Y = P_Y_list[sort_ind]

for p, y in sorted_P_Y:
    counts[p] += 1
    id_list.append(str(p).zfill(6) + str(counts[p]).zfill(6))
id_list = np.array(id_list)
id_list = id_list[np.argsort(sort_ind)]
for id in id_list:
    print(id)
# -*- coding: utf-8 -*-
import sys

a = sys.args[0]
b = sys.args[1]

garden = (a-1) * (b-1) + 1
print(garden)


### FIXED CODE ###

# -*- coding: utf-8 -*-

l = input().split()
a = int(l[0])
b = int(l[1])

garden = (a-1) * (b-1)
print(garden)
import math

N = int(input())
a = list(map(int, input().split()))
ans = 0
num = 0
for i in range(1, len(a)):
	num *= int(a[i-1] * a[i] / math.gcd(a[i-1],a[i]))
num -= 1
for i in range(len(a)):
	ans += num % a[i]
print(ans)

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
ans = 0
for x in a:
	ans += x - 1
print(ans)
#16D8103010K Ko Okasaki
#ALDS4_B

n=int(input())
Q=input.split()
q=int(input())
S=input.split()

Q=list(map(int,Q))
S=list(map(int,S))

cnt=1

for i in range(q):
	left=0
	right=n-1
	while left<=right:
		mid=int((n-1)/2)
		if S[mid]==Q[i]:
			cnt+=1
			break
		elif S[mid]>Q[i]:
			right=mid
		elif S[mid]<Q[i]:
			left=mid

print(cnt)



### FIXED CODE ###

n=int(input())
S=input().split()
q=int(input())
T=input().split()

S=list(map(int,S))
T=list(map(int,T))

cnt=0

for i in range(q):
	left=0
	right=n-1
	while left<=right:
		mid=int((left+right)/2)
		if S[left]>T[i] and S[right]<T[i]:
			break
		if S[mid]==T[i]:
			cnt+=1
			break
		elif S[mid]>T[i]:
			right=mid-1
		elif S[mid]<T[i]:
			left=mid+1

print(cnt)
N,K=map(int,input().split())
a_ls=list(map(int,input().split()))
f_ls=list(map(int,input().split()))

a_ls.sort()
f_ls.sort()
f_ls.reverse()

def can_eat_by(x):
    cost_after_training=list(map(lambda item: x//item, f_ls))
    sum=0
    for i in range(N):
        if a_ls[i]>cost_after_training[i]:
            sum+=a_ls[i]-cost_after_training[i]
    return sum<=K

left=0
right=10**12
prev_x=-10
while True:
    next_x=(right+left)//2
    if can_eat_by(next_x):
        answer=next_x
        right=next_x
    else:
        left=next_x
    if abs(next_x-prev_x)<=1:
        break
    prev_x=next_x
print(answer)

### FIXED CODE ###

def main():
    N,K=map(int,input().split())
    a_ls=list(map(int,input().split()))
    f_ls=list(map(int,input().split()))
    
    a_ls.sort()
    f_ls.sort()
    f_ls.reverse()
    
    def can_eat_by(x):
        cost_after_training=list(map(lambda item: x//item, f_ls))
        sum=0
        for i in range(N):
            if a_ls[i]>cost_after_training[i]:
                sum+=a_ls[i]-cost_after_training[i]
        return sum<=K
    
    left=-1
    right=10**12
    prev_x=-10
    # 二分探索でtest(x)がtrueとなるxの最小値を探索する
    # left = rightとなるまで繰り返す
    while left + 1 < right:
      mid = (left+right)//2
      
      # mid秒で食べられる場合は探索範囲の右端をmidにする
      if can_eat_by(mid):
        right = mid
      # mid秒で食べられない場合は探索範囲の左端をmidにする
      else:
        left = mid
     
    answer = right
    print(answer)

main()
N,M,Q = map(int,input().split())
num = [[0 for i in range(N)] for j in range(N)]
lr = [list(map(int,input().split())) for i in range(M)]
for l,r in lr:
    num[l-1][r-1] += 1

for j in range(N):
    for i in range(N-1,0,-1):
        num[i-1][j] += num[i][j]
for i in range(N):
    for j in range(N-1):
        num[i][j+1] += num[i][j]
pq = [list(map(int,input().split())) for i in range(M)]
for p,q in pq:
    print(num[p-1][q-1])


### FIXED CODE ###

N,M,Q = map(int,input().split())
num = [[0 for i in range(N)] for j in range(N)]
for i in range(M):
    l,r = list(map(int,input().split()))
    l -= 1
    r -= 1
    num[l][r] += 1
for i in range(N):
    for j in range(N-1):
        num[i][j+1] += num[i][j]
for i in range(N-1,0,-1):
    for j in range(N):
        num[i-1][j] += num[i][j]
for i in range(Q):
    p,q = map(int,input().split())
    print(num[p-1][q-1])
from collections import deque

def bfs(graph, start, goal, connection):
    visited = {start: None}
    unvisited = deque()
    unvisited.append(start)
    while unvisited:
        now = unvisited.popleft()
        if now == goal or goal in connection[now]:
            connection[start].add(goal)
            connection[goal].add(start)
            return "yes"
        for next in graph[now]:
            if not (next in visited):
                unvisited.append(next)
                visited[next] = now
    return "no"

n, m = map(int, input().split())
g = [set() for i in range(n)]
c = [set() for i in range(n)]

for i in range(m):
    a, b = map(int, input().split())
    g[a].add(b)
    g[b].add(a)
    c[a].add(b)
    c[b].add(inp[a])

q = int(input())

for i in range(q):
    s, t = map(int, input().split())
    print(bfs(g, s, t, c))

### FIXED CODE ###

from collections import deque

def bfs(graph, start):
    visited = {start: None}
    unvisited = deque()
    unvisited.append(start)
    while unvisited:
        now = unvisited.popleft()
        for next in graph[now]:
            if not (next in visited):
                unvisited.append(next)
                visited[next] = now
    return visited

n, m = map(int, input().split())
g = [set() for i in range(n)]
group = []

for i in range(m):
    a, b = map(int, input().split())
    g[a].add(b)
    g[b].add(a)

q = int(input())

for i in range(q):
    s, t = map(int, input().split())
    for j in range(len(group)):
        if s in group[j] and t in group[j]:
            print("yes")
            break
        elif s in group[j]:
            print("no")
            break
    else:
        group_tmp = set(bfs(g, s).keys())
        if t in group_tmp:
            print("yes")
        else:
            print("no")
        group.append(group_tmp)
n,x=map(int,input().split())
m=[]
for i in range(n):
  m.append(int(input())
m.sort()
print((x-sum(m))//m[0] +n)

### FIXED CODE ###

n,x=map(int,input().split())
m=[]
for i in range(n):
  k=int(input())
  m.append(k)
m.sort()
print((x-sum(m))//m[0] +n)
n = int(input())
t=[]
t = map(int, input())
bottle_neck = min(t)[0]
ti = int(n/bottle_neck)
ti+=1
print(ti+4)



### FIXED CODE ###

#a,b,c = map(int,inpput().split(" "))
#n = int(input())
#print(a,b,c)
t=[]
for i in range(5):
    t.append(int(input()))
n = int(input())
flag = True
for i in range(5):
    for j in range(5-i-1):
        if abs(t[i]-t[j+i+1]) >n:
            flag =False
            break
if not flag:
    print(":(")
else:
    print("Yay!")
import sys

sys.setrecursionlimit(10 ** 5)

N = int(input())
T = [[] for _ in range(N)]
for i in range(1, N):
    x = int(input()) - 1
    T[x].append(i)


def f(x):
    candidates = sorted([f(y) for y in T[x]], reverse=True)
    return max((c + i for i, c in enumerate(candidates, 1)), default=0)


print(f(0))


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 9)

N = int(input())
T = [[] for _ in range(N)]
for i in range(1, N):
    x = int(input()) - 1
    T[x].append(i)


def f(x):
    candidates = sorted([f(y) for y in T[x]], reverse=True)
    return max((c + i for i, c in enumerate(candidates, 1)), default=0)


print(f(0))
a,b =map(int(i) for i in input.split())
if a > b:
 print("a > b")
elif  a == b:
 print("a == b")
else : 
 print("a < b")


### FIXED CODE ###

a,b =map(int, input().split())
if a > b:
 print("a > b")
elif  a == b:
 print("a == b")
else : 
 print("a < b")