peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n,c,k = map(int,input().split())
t = [int(input()) for i in range(n)]

t.sort()

bus = 0
dis = t[0] + k
temp = 0 

for i in range(n):
    if (t[i] > dis) or (temp+1 > c):
        bus += 1
        dis = t[i]+k
        temp = 1
        
        
    else:
        temp += 1
            
    

print(bus+1)
# Judge status: Accepted
a = input()
print("Yes" if a[0] == "9" or a[1] == "9" else "No")
# Judge status: Wrong Answer
import numpy as np

n = int(input())
a = input().split()
np_a=np.array(a, dtype=int)

sum=np.int(sum(np_a))
count=np.zeros(100001, dtype='int64')
for i in range(0,n):
  count[np_a[i]]+= 1
  
change=np.array(range(100001))

q = int(input())
for i in range(0,q):
  b, c= map(int, input().split())
  count[c]=count[c]+count[b]
  sum=sum+(c-b)*count[b]
  
  print (sum)
# Judge status: Accepted
a,b=map(int,input().split())
score=0
n=0
while n<2:
    if a>b:
        score+=a
        a-=1
    else:
        score+=b
        b-=1
    n+=1
print(score)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

A.sort(reverse=True)
print(sum(A[0::2]) - sum(A[1::2]))
# Judge status: Accepted
S = input()
print(S+'s' if S[-1]!='s' else S+'es')
# Judge status: Wrong Answer
N=int(input())
d=[input().split() for i in range(N)]
name=[]
for i in range(N):
    d[i].append(i+1)
    name.append(d[i][0])
Name=list(set(name))
Name.sort()
print(Name)
d.sort()
for i in range(len(Name)):
    li=[]
    for j in range(N):
        if Name[i]==d[j][0]:
            li.append([d[j][1],d[j][2]])
        else:
            continue
    li.sort()
    Li=li[::-1]
    for k in range(len(li)):
        print(Li[k][1])
# Judge status: Accepted
A,B = map(int,input().split())
ans = 0
for x in range(A,B+1):
    if int(str(x)[::-1]) == x:
        ans += 1
print(ans)
# Judge status: Accepted
a,b,x=map(int,input().split())
print(b//x-(a-1)//x if a>0 else b//x+1)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = []
total = 0
x = 0

while 1:
    cnt = 0
    for i in a:
        if i%2==0:
            a[cnt]=i/2
            cnt += 1
        else:
            x += 1
            break
    if x!=0:
        break
    total += 1

print(total)
# Judge status: Accepted
import numpy as np
from collections import Counter

n = int(input())
a = list(map(int,input().split()))
a.sort()

dp = [0]*(a[-1]+1)
dp = np.array(dp,int)

for i in a:
    dp[i] = 1

for i in a:
    if dp[i] == 1:
        dp[2*i::i] = 0

c = Counter(a)

for i,j in c.items():
    if j > 1:
        dp[i] = 0

print(dp.sum())
# Judge status: Accepted
X = input()
cnt = 0
for x in X:
    if x == 'T' and cnt:
        cnt -= 1
    elif x == 'S':
        cnt += 1
print(2*cnt)
# Judge status: Accepted
A, B = map(int, input().split())
S = input()

if S[:A].isdecimal() and S[A] == "-" and S[A + 1 :].isdecimal():
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
tmp=set(A)
tmp=list(tmp)


if len(tmp)==len(A):
  print ("Yes")
else:
  print ("No")
# Judge status: Accepted
from collections import Counter

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

aa = Counter(a)
ans = 0

if len(aa) > k:
	value = sorted(aa.values())
	ans = sum(value[:len(aa)-k])

print(ans)
# Judge status: Accepted
s = input()

print(s.replace("?","D"))
# Judge status: Wrong Answer
N = int(input())
l = list(map(int,input().split()))
l_r = sorted(l,reverse=True)
Alice = l_r[::2]
Bob = l_r[1::2]

m =0
n = 0
for i in Alice:
    m += i
for j in Bob:
    n += j
print({m-n})
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a >= 13:
    ans = b
elif a >= 6:
    ans = b / 2
else:
    ans = 0
print(ans)
# Judge status: Accepted
def run():
  H, N = map(int, input().split())
  A_sum = sum(map(int, input().split()))
  if H-A_sum > 0:
    print('No')
  else:
    print('Yes')
  
if __name__ == '__main__':
  run()
# Judge status: Accepted
X = int(input())
ans = 0

while X - 500 >= 0:
    ans += 1000
    X -= 500
while X - 5 >= 0:
    ans += 5
    X -= 5

print(ans)
# Judge status: Wrong Answer
ab = input().replace(" ", "")
ab = int(ab)

import numpy as np
s = np.array(range(2,101))
s = s**2
s = list(s)

if ab in s:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def main():
    N,K = map(int,input().split())
    h = list(map(int,input().split()))
    INF = 10**10
    DP = [INF]*N
    DP[0] = 0
    DP[1] = abs(h[1]-h[0])
    for i in range(2,N):
        DP[i] = min(DP[i-j] + abs(h[i-j]-h[i]) for j in range(1,min(K,i)+1))
    print(DP[-1])
    
if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a,b=map(int,input().split())
s=input()
t=True
if s[a]=="-":
    x,y=s[:a],s[a+1:]
    print(x,y)
    if "-" in x or "-" in y:
        t=False
else:
    t=False
print("Yes" if t else "No")
# Judge status: Accepted
from math import*

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

ans = 0
for i in range(1, n+1):
    if i < k:
        ans += (1/n)*(1/2)**ceil(log2(k/i))
    else:
        ans += 1/n

print(ans)
# Judge status: Accepted
import math

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

max_value = 0
x = B - 1
if x > N:
    x = N
max_value = math.floor(A * x / B) - A * math.floor(x / B)
# for x in range(1, N+1):
#     value = math.floor(A * x / B) - A * math.floor(x / B)
#     print("X:", x, "value:", value)
#     max_value = max(max_value, value)

print(max_value)
# Judge status: Accepted
n=int(input())

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

m=2*10**5+1

ans=0

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

print(ans)
# Judge status: Accepted
ans = [1]*365
for i in range(365):
    ans[i]=i%25 + 2
for i in range(365):
    print(ans[i])
# Judge status: Wrong Answer
n=int(input())
city=[int(input()) for _ in range(5)]
print(5+n//min(city))
# Judge status: Accepted
L, R, d = map(int, input().split())
r = 0
for i in range(L, R+1):
    if i % d == 0:
        r += 1
print(r)
# Judge status: Accepted
N = int(input())

dp = [-1]*(N+1)
dp[0] = 0
dp[1] = 1
for i in range(1, N+1):
    if dp[i] == -1:
        dp[i] = dp[i-1] + 1
        k = 6
        while i >= k:
            dp[i] = min(dp[i], dp[i-k]+1)
            k *= 6
        l = 9
        while i >= l:
            dp[i] = min(dp[i], dp[i-l]+1)
            l  *= 9
print(dp[N])
# Judge status: Accepted
N = int(input())
flag = False
for i in range(N//4+1):
    if (N-4*i) % 7 == 0:
        flag = True
        break
if flag:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
k, a, b = map(int, input().split())

ans = 0
if b - a < 2:
  ans = k + 1
else:
  ans = a
  k -= a - 1
  ans += (b - a) * (k // 2) + k % 2

print(ans)
# Judge status: Accepted
import itertools

N = int(input())
P = tuple(map(int,input().split()))
Q = tuple(map(int,input().split()))

permutation_list = list(itertools.permutations(range(1,N+1),N))
a = permutation_list.index(P)
b = permutation_list.index(Q)
print(abs(a-b))
# Judge status: Accepted
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

n = int(input())
a = list(map(int,input().split()))
c = collections.Counter(a)
item = []
for key,value in c.items():
    item.append([key,value])
cnt = 0
for i in range(len(item)):
    if item[i][0] == item[i][1]:
        continue
    elif item[i][0] < item[i][1]:
        cnt += item[i][1] - item[i][0]
    else:
        cnt += item[i][1]
print(cnt)
# Judge status: Accepted
l = list(map(int, input().split()))
print(sum(l)-max(l))
# Judge status: Wrong Answer
def soma(n):
    x = sum(int(digit) for digit in str(n))
    if x < 10:
        return x
    else:
        return soma(x)

def main():
    n = int(input())

    somad = soma(n)
    
    for i in range(1, n):
        soman = soma(i)+soma(n-i);
        if(soman==somad):
            break
    
    print(soman,"\n")
       
main()
# Judge status: Wrong Answer
n = int(input())
v = sorted(map(int,input().split()))

value = v[0]
for i in range(1,n):
    value = (value + v[i]) / 2
print(int(value))
# Judge status: Wrong Answer
l = input().split(" ")
n = int(l[0])
m = int(l[1])

r = []
l = []

for i in range(m):
    gatei = input().split(" ")
    li = int(gatei[0])
    ri = int(gatei[1])
    l.append(li)
    r.append(ri)

l.sort()
r.sort()

count = r[0] - l[m-1] + 1
print(count)
# Judge status: Wrong Answer
from collections import deque

n, m = map(int, input().split())
part = []
for i in range(n):
    part.append(list(map(int, input().split())))
part.sort(reverse=True)
part.sort(reverse=True, key=lambda x: x[1])
print(part)

que = deque()
for i in part:
    que.append(i)

ans = 0
for day in range(1, n + 1):
    while que:
        work = que.popleft()
        if day + work[0] <= m + 1:
            ans += work[1]
            break
    if not que:
        break

print(ans)
# Judge status: Accepted
def dis(a, b, c, d):
    num = abs(a - c) + abs(b - d)
    return num

n,m = map(int,input().split())
a = [0] * n
b = [0] * n
c = [0] * m
d = [0] * m

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

for i in range(n):
    ans = []
    for j in range(m):
        ans.append(dis(a[i],b[i],c[j],d[j]))
    print(ans.index(min(ans)) + 1)
# Judge status: Wrong Answer
import sys,collections,math,random,fractions,bisect;sys.setrecursionlimit(10**7)
sr = sys.stdin.readline; P = print; P2 = lambda x: print(*x, sep="\n")
def I(i=0): t = [int(x)-i for x in sr().split()];return t if len(t) > 1 else t[0]
def S(): t = sr().split(); return t if len(t) > 1 else t[0]
L1,L2,L3,L4, = [],[],[],[]

N,K = I()
A = I()
if N == K:
    print(0)
else:
    print(sum(sorted(A)[:N-K]))
# Judge status: Wrong Answer
N,K=map(int,input().split())
listH=list(map(int,input().split()))
cost=[10**5]*N
cost[0]=0
for i in range(1,N):
  for k in range(K):
    if i-k>=0:
      cost[i]=min(abs(listH[i-k]-listH[i])+ cost[i-k],cost[i])
ans=cost[-1]      
print(ans)
# Judge status: Accepted
S = input().strip()
N = len(S)
flag = 0
if S=="keyence":
    flag = 1
else:
    for i in range(N):
        for j in range(i,N):
            x = S[:i]
            y = S[j+1:]
            if x+y=="keyence":
                flag = 1
                break
        if flag==1:break
if flag==1:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
n, h = map(int, input().split())
AB = [(list(map(int, input().split()))) for _ in range(n)]

A = []
B = []
for a, b in AB:
    A.append(a)
    B.append(b)

max_A = max(A)
C = [b for b in B if b >= max_A]
sum_C = sum(C)
ans = len(C)
if sum_C >= h:
    print(ans)
else:
    h -= sum_C
    atack = h // max_A
    ans += atack
    h -= atack * max_A
    if h <= 0:
        print(ans)
    else:
        print(ans+1)
# Judge status: Accepted
k,n = map(int,input().split())
a = [int(x) for x in input().split()]

d = []
for i in range(n-1):
    d.append(a[i+1] - a[i])
d.append(k-a[n-1]+a[0])
print(sum(d) - max(d))
# Judge status: Wrong Answer
from collections import Counter

def solve(n, A):
    c = Counter(A)
    cands = sorted(filter(lambda kv: kv[1] >= 2, c.items()),  key=lambda kv: -kv[0])
    return cands[0][0] * cands[1][0] if len(cands) >= 2 else 0

_n = int(input())
_A = map(int, input().split())
print(solve(_n, _A))
# Judge status: Wrong Answer
import numpy as np

def Speed_Anag_Count(String):
    count = {}
    for i in String:
        i = sorted(i)
        i = str(''.join(i))
        if count.get(i) != True:
            count[i] = 0
        count[i] += 1
    
    return count

N = int(input())

S = [str(input()) for _ in range(N)]

count = Speed_Anag_Count(S)

ans=1
for i in count.values():
    ans = ans*(i*(i-1)/2)
    
print(int(ans))
# Judge status: Accepted
n = int(input())
a = list(enumerate(map(int, input().split()),start=1))
from operator import itemgetter
a.sort(key=itemgetter(1))

print(*[n[0] for n in a])
# Judge status: Wrong Answer
import numpy as np

N, M = map(int, input().split())
a = [input().split() for i in range(N)]
# a = [[int(i[0]), int(i[1])] for i in a]
a = np.array(a, dtype='int64')
a = a[a[:, 0].argsort(), :]
print(a)

mysum = 0
coin = 0
for c in a:
    if mysum + c[1] < M:
        mysum += c[1]
        coin += c[0] * c[1]
    else:
        d = M - mysum
        coin += d * c[0]
        break

print(coin)
# Judge status: Wrong Answer
import sys
x=int(input())
n = x
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)

if x==1 or 2:
    print(2)
    sys.exit()
if x%2==0:
    x=x+1
while True:
    if all(x%i!=0 for i in primes):
        print(x)
        sys.exit()
    else:
        x=x+2
# Judge status: Wrong Answer
def jds(strin):
    js = 0
    nn = len(strin)
    for kk in range(int(nn / 2)):
        if strin[kk] == strin[nn - kk -1]:
            js = 1
    return js

a = input()
jud = 0

b = a[:int((len(a) - 1) / 2)]
c = a[int((len(a) +2) / 2):]

jud += jds(a) + jds(b) + jds(c)

if jud == 3:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import math

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

for i in range(min(math.ceil(math.log(N)), K)):
  B = [0] * N
  for n, A_n in enumerate(A):
    B_min = max(0, n-A_n)
    b_max = min(N-1, n+A_n)
    B[B_min] += 1
    if b_max+1 < N:
      B[b_max+1] -= 1
  
  sum = 0
  for n in range(len(A)):
    sum += B[n]
    A[n] = sum

  print(" ".join(list(map(str, A))))
# Judge status: Accepted
from collections import Counter
N = int(input())
A = [int(input()) for _ in range(N)]
C = Counter(A)
ans = sum(C[key] % 2 for key in C)
print(ans)
# Judge status: Accepted
N = int(input())
nums = [int(input()) for _ in range(N)]

ans = sum(nums)
m = sorted([num for num in nums if num % 10 != 0])

if ans % 10 != 0:
    print(ans)
elif len(m) > 0:
    print(ans - m[0])
else:
    print(0)
# Judge status: Accepted
from itertools import groupby
n = int(input())
P = list(map(int, input().split()))

j = [False] * (n+1)
for i, p in enumerate(P):
    if i+1 == p:
        j[i] = True

cnt = 0
gr = groupby(j)
for key, group in gr:
    l = len(list(group))
    if key and l != 1:
        cnt += l//2 if l % 2 == 0 else l//2+1
    elif key:
        cnt += 1

print(cnt)
# Judge status: Accepted
o = input()
e = input()
for i in range(len(e)):
  print(o[i], end='')
  print(e[i], end='')
if len(o) > len(e):
  print(o[-1], end='')
print()
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

import math
l_gcd = []
r_gcd = []

c = a[0]
for i in a[::-1]:
  c = math.gcd(c, i)
  l_gcd.append(c)
  
c = a[-1]
for j in a[1:][::-1]:
  c = math.gcd(c, j)
  r_gcd.append(c)
  
ans = max(r_gcd[-1], l_gcd[-1])
for r, l in zip(r_gcd[:-1], l_gcd[:-1][::-1]):
  c = math.gcd(r, l)
  ans = max(ans, c)
print(ans)
# Judge status: Accepted
#A
p, q, r = map(int, input().split())
print(p + q + r - max(p, q, r))
# Judge status: Accepted
a, b, c = map(int, input().split())
if a+b == c or a == b+c or b == a+c:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n, k = map(int,input().split())
a = input().split()
for i in range(n-k):
    if a[i] < a[i+k]:
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
import re
import sys

s = str(sys.stdin.buffer.readline().rstrip())
c = [2019*i for i in range(1, 1000)]
ans = 0

for i in range(999):
    tmp = str(c[i])
    if tmp in s:
        index = -1
        while True:
            index = s.find(tmp, index + 1)
            if index == -1:
                break
            ans += 1
print(ans)
# Judge status: Accepted
N, A, B = [int(x) for x in input().split()]
S = list(input())
go = 0
go_abroad = 0
for i in range(N):
  if(go)<(A+B):
    if(S[i]=='a'):
      print('Yes')
      go += 1
    elif(S[i]=='b') and (go_abroad<B):
      print('Yes')
      go += 1
      go_abroad += 1
    else:
      print('No')
  else:
    print('No')
# Judge status: Accepted
import collections
import heapq
n = int(raw_input())
ais = [0] + map(int, raw_input().split()) 
#print ais
res = [0 for __ in range(n +1)]
for u in range(n, 0, -1):
	c = u*2
	cumul = 0
	while(c <= n):
		cumul += res[c]
		c += u
	if ais[u] != (cumul % 2): 
		res[u] = 1
s = sum(res)
print s
if s:
	print ' '.join([str(i) for i in range(len(res)) if res[i] == 1])
# Judge status: Accepted
N, Y = map(int, input().split(' '))

for man in range(N+1):
    for go in range(N-man+1):
        if (10000*man+5000*go+1000*(N-man-go)) == Y:
            print('{} {} {}'.format(man, go, N-man-go))
            exit()

print('{} {} {}'.format(-1, -1, -1))
# Judge status: Wrong Answer
s = input()

# 1
n = len(s)
case0=0
case1=0

for i in range(n):
  if (i%2==0):
    if s[i]=='0':
      case0 += 1
    else:
      case1 += 1

print(min(case0,case1))
# Judge status: Accepted

def main():
    s = input().split()
    print(s[0][0].upper()+s[1][0].upper()+s[2][0].upper())


if __name__ == "__main__":
    main()
# Judge status: Accepted
#!/usr/bin python3
# -*- coding: utf-8 -*-

def main():
    a,b = map(int,input().split())
    if a <= 8 and b <= 8:
        print("Yay!")
    else:
        print(":(")

if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
import math
import bisect

def solve(A, m):
    n = len(A)
    min_val = 10 ** 18
    A.sort()
    for i in range(n):
        if i + m <= n:
            val = A[i+m-1] - A[i]
            min_val = min(min_val, val)
    return min_val

def main():
    n, m = map(int, input().split())
    A = []
    for i in range(n):
        A.append(int(input()))
    print(solve(A, m))

if __name__ == "__main__":
    main()
# Judge status: Accepted
n = int(input())
x = list(map(int, input().split()))

ans = 10**10

for j in range(1,101):
    tmp = 0
    for i in range(n):
        tmp += (j - x[i])**2
    ans = min(ans, tmp)

print(ans)
# Judge status: Accepted
x = int(input())
count = 0
sum = 0
while(1):
    count += 1
    sum += count
    if sum >= x:
        print(count)
        break
# Judge status: Wrong Answer
import math

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

lcm = c*d / math.gcd(c,d)

def num(i):
  ans = int(b/i) - int(a/i)
  if a % i == 0:
    ans +=1
  return ans

lcm_num = num(lcm)

cd_num  = num(c) + num(d)

num = cd_num - lcm_num

print(b-a+1-num)
# Judge status: Accepted
a,b=map(int,input().split())

print("safe" if a>b else "unsafe")
# Judge status: Wrong Answer
sx, sy, tx, ty = map(int, input().split())

right_shift = tx - sx
for i in range(right_shift):
    print('R', end='')

up_shift = ty - sx
for i in range(up_shift):
    print('U', end='')

for i in range(right_shift):
    print('L', end='')

for i in range(up_shift + 1):
    print('D', end='')

for i in range(right_shift + 1):
    print('R', end='')

for i in range(up_shift + 1):
    print('U', end='')

for i in range(right_shift + 1):
    print('L', end='')

for i in range(up_shift + 1):
    print('D', end='')
    
print('R')
# Judge status: Wrong Answer
s = input()
if s[0:7] == "keyence":
    print("YES")
elif s[-7:] == "keyence":
    print("YES")
elif s[0:3] == "key" and s[-4:] == "ence":
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

a.sort()
amax=max(a)
dp=[True]*(amax+1)

import collections
c = collections.Counter(a)

d=[]
for ck,cv in c.items():
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
aa=set()
for ai in a:
    if dp[ai]:
        aa.add(ai)
        for aj in range(ai*2,amax+1,ai):
            dp[aj]=False

aa=aa-dset    
print(len(aa))
# Judge status: Wrong Answer
n = int(input())
l = list(map(int,input().split()))

ai = []
aj = []
ans = 0
aiajmin = -9999999


for i in range(n):
    ai.append(i+l[i])

for j in range(n):
    aj.append(j-l[j])

#print(ai)
#print(aj)
    
aiajmin = min(max(ai),max(aj))

for x in range(n):
    if(ai[x] <= aiajmin):
        ans = ans + aj.count(ai[x])
    else:
        break
    
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(300000)


def solve(N: int):
    ret = (N + 1) // 2 
    print(ret)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
S = input()
S = str()

print(S[:3])
# Judge status: Wrong Answer
if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    b = 1

    if a[0]<= 0 and a[1]>=0:
        b=0
    elif b<0:
        c = abs(a-b)+1
        if c %2 ==1:
            b=-1


    if b >0:
        print("Positive")
    elif b ==0:
        print("Zero")
    else:
        print("Negative")
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
x = len(A)
count = 0
num = 1
for i in A:
  if i == num:
    count += 1
    num += 1
if count == 0:
  print(-1)
else:
  print(x-count)
# Judge status: Wrong Answer
from collections import deque

N, M = map(int, input().split())
net = [[] for _ in range(N+1)]
vect = [0]*(N+1)

for _ in range(M):
	A, B = map(int, input().split())
	net[A].append(B)
	net[B].append(A)

q = deque()
q.append(1)

while len(q)>0:
	t = q.popleft()
	for i in net[t]:
		if t != i and vect[i] == 0:
			vect[i] = t
			q.append(i)

for i in range(2, N+1):
	print(vect[i])
# Judge status: Accepted
B=set(input().split())
print(len(B))
# Judge status: Accepted
import bisect

n,m,k=map(int,input().split())
arr1=list(map(int,input().split()))
arr2=list(map(int,input().split()))
acum1=[0]
for i in range(n):
  acum1.append(acum1[-1]+arr1[i])
acum2=[0]
for i in range(m):
  acum2.append(acum2[-1]+arr2[i])
ans=0
for i in range(n+1):
  if acum1[i]>k:
    break
  ans=max(ans,i+bisect.bisect_right(acum2,k-acum1[i])-1)
print(ans)
# Judge status: Wrong Answer
n,m=map(int,input().split())
A=[list(map(int,input().split()))for i in range(n)]
print(A)
A=sorted(A,key=lambda y:y[0])
print(A)
cnt=0#ドリンクの本数
ans=0
for i in range(n):
    cnt+=A[i][1]
    if m<=cnt:
        over=cnt-m #mを超えた時の超過本数
        ans+=(A[i][0]*A[i][1])-(over*A[i][0])
        break
    else:
        ans+=A[i][0]*A[i][1]
print(ans)
# Judge status: Wrong Answer
import math
N, A, B = [int(i) for i in input().split()]
count = A + B
setCount = math.floor(N / count)
amari = N - math.floor(setCount) * count
result = setCount * A + amari
print(result)
# Judge status: Wrong Answer
A,B,T=map(int,input().split())
print((T+0.5)//A*B)
# Judge status: Wrong Answer
n,c,k=[int(x) for x in input().rstrip().split()]
t=[]
for i in range(n):
  T = int(input())
  t.append([T,T+k])

t=sorted(t,key=lambda x :x[0])


right=0
ans=0
cnt=0
for s,e in t:
  if s<= right<=e:
    cnt+=1
    if cnt==c:
      ans+=1
      right=e
  else:
    ans+=1
    right=e
print(ans)
# Judge status: Wrong Answer
s = input()
a = int(s[0:2])
b = int(s[2:4])
if 0 < a <= 12 and 0 < b <= 12:
    print("AMBIGUOUS")
elif a > 12 and b > 12 or a == 0 or b == 0:
    print("NA")
elif a > 12:
    print("YYMM")
else:
    print("MMYY")
# Judge status: Wrong Answer
n = list(input())
a = int(''.join(n))
b = []
b.append(int(n[0]) * 111)
b.append(int(n[1]) * 111)
b.append(int(n[2]) * 111)
b = sorted(b)
if a % 111 == 0:
    print(a)
for i in range(3):
    if b[i] > a:
        print(b[i])
        exit()
# Judge status: Accepted
# -*- coding: utf-8 -*-
# 標準入力の取得
K = int(input())
A,B = list(map(int, input().split()))

# 求解処理
min_value = K * (A // K)
if min_value < A:
    min_value += K
result = ""
if min_value <= B:
    result = "OK"
else:
    result = "NG"

# 結果出力
print(result)
# Judge status: Wrong Answer
import itertools
n = int(input())
p = list(input().split())
q = list(input().split())
p = ''.join(p)
q = ''.join(q)
n_list = [str(i) for i in range(1, n + 1)]
n_comp = list(itertools.permutations(n_list, n))
n_join = []
for i in n_comp:
    n_join.append(''.join(i))
n_join.sort()

a = 0
b = 0
for i in range(len(n_join)):
    if n_join[i] == p:
        a = i
    elif n_join[i] == q:
        b = i
print(abs(a - b))
# Judge status: Accepted
N,Q = map(int,input().split())
S = input().strip()
A = [0 for _ in range(N)]
for i in range(1,N):
    if S[i-1:i+1]=="AC":
        A[i] = A[i-1]+1
    else:
        A[i] = A[i-1]
for _ in range(Q):
    l,r = map(int,input().split())
    print(A[r-1]-A[l-1])