Harryxun/stf_run huggingface dataset:
import numpy as np

N, K, Q = map(int, input().split())
A = [int(input()) for i in range(Q)]
N_array = [K] * N
np = np.array(N_array)
for x in A:
    np -= 1
    np[x - 1] += 1
for z in np:
    if z > 0:
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

N, K, Q = map(int, input().split())
A = [int(input()) for i in range(Q)]
N_array = [K - Q] * N
for x in A:
    N_array[x - 1] += 1
for z in N_array:
    if z > 0:
        print("Yes")
    else:
        print("No")
H, N = map(int, input().split())
A= [0] * N
for i in range(N):
    A[i]= map(int, input().split())
 
if (sum(A[i]>N):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

H,N = map(int,input().split())
A = list(map(int, input().split()))
if sum(A)>=H:
    print("Yes")
else:
    print("No")
from collections import deque
import sys

sys.setrecursionlimit(10**9)

h, w = map(int,input().split())
ch, cw = map(lambda x: int(x) - 1, input().split())
dh, dw = map(lambda x: int(x) - 1, input().split())

G = []
for i in range(h):
    G.append(list(input()))

queue = deque([(ch-1, cw-1)])
S = [[float("inf")]*w for _ in range(h)]
S[ch][cw] = 0

while queue:
    y, x = queue.popleft()
    dx_dy = ((1,0),(0,1),(-1,0),(0,-1))
    ans = S[y][x]

    if (y, x) == (dy, dx):
            S[y][x] = ans
            break

    for j, i in dx_dy:
        if 0 <= x+i < w and 0 <= y+j < h:
            if S[y+j][x+i] > S[y][x] and G[y+j][x+i] == ".":
                S[y+j][x+i] = ans
                queue.appendleft((y+j, x+i))

    ans += 1
    for i in range(-2, 3):
        for j in range(-2, 3):
            if i != 0 and j != 0:
                if 0 <= x+i < w and 0 <= y+j < h:
                    if S[y+j][x+i] > ans and G[y+j][x+i] == ".":
                        S[y+j][x+i] = ans
                        queue.append((y+j, x+i))


if S[dh][dw] == float("inf"):
    print(-1)
else:
    print(S[dh][dw])


### FIXED CODE ###

from collections import deque


h, w = map(int,input().split())
ch, cw = map(lambda x: int(x) - 1, input().split())
dh, dw = map(lambda x: int(x) - 1, input().split())

G = []
for i in range(h):
    G.append(list(input()))

queue = deque([(ch, cw)])
S = [[float("inf")]*w for _ in range(h)]
S[ch][cw] = 0

while queue:
    y, x = queue.popleft()
    dx_dy = ((1,0),(0,1),(-1,0),(0,-1))
    ans = S[y][x]

    if (y, x) == (dh, dw):
            S[y][x] = ans
            break

    for j, i in dx_dy:
        if 0 <= x+i < w and 0 <= y+j < h and S[y+j][x+i] > ans and G[y+j][x+i] == ".":
            queue.appendleft((y+j, x+i))
            S[y+j][x+i] = ans
            

    ans += 1
    for i in range(-2, 3):
        for j in range(-2, 3):
            if 0 <= x+i < w and 0 <= y+j < h and S[y+j][x+i] > ans and G[y+j][x+i] == ".":
                S[y+j][x+i] = ans
                queue.append((y+j, x+i))


if S[dh][dw] == float("inf"):
    print(-1)
else:
    print(S[dh][dw])
N, Q = [int(n) for n in input().split()]

tree_list = {n:[] for n in range(1, N+1)}
count_list = {n:0 for n in range(1, N+1)}

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

#print(tree_list)
#print(count_list)

def func(pn, xn):
    count_list[pn] += xn
    for k in tree_list[pn]:
        func(k, xn)

for j in range(Q):
    p, x = [int(n) for n in input().split()]
    func(p, x)
    
#print(count_list)

print(' '.join([str(v) for v in count_list.values()]))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
N, Q = [int(n) for n in input().split()]
tree_list = [[] for _ in range(N)]

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

score_list = [0] * N
for j in range(Q):
    p, x = [int(n) for n in input().split()]
    score_list[p-1] += x

reached = [False] * N
def dfs(v):
    reached[v] = True
    for next_v in tree_list[v]:
        if reached[next_v] == True:
            continue
        score_list[next_v] += score_list[v]
        dfs(next_v)
dfs(0)
print(*score_list)
S = input()
T = input()
replaces = 0
for ch in range(S):
    if S[ch] == T[ch]:
        replaces += 1

print(replaces)


### FIXED CODE ###

S = input()
T = input()
replaces = 0
for ch in range(len(S)):
    if S[ch] != T[ch]:
        replaces += 1

print(replaces)
import sys
 
l = []
for line in sys.stdin.readline():
  l.append(line)

for i in l:
  a,op,b=i.split()
  if op == '?':
    break
  print eval(i)

### FIXED CODE ###

import sys
  
for line in sys.stdin:
  a,op,b=line.split()
  if op == '?':
    break
  print eval(line)
import math

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

# cとdの最大公約数
g = math.gcd(c, d)

# cとdの最小公倍数
l = c * d // g

# cとdで割り切れないb以下の数の個数
# (全体) - (cの倍数の個数) - (dの倍数の個数) + (cの倍数かつdの倍数の個数)
x = b - b // c - b // d + b // l

# cとdで割り切れない(a-1)以下の数の個数
y = (a - 1) - (a - 1) // c - (a - 1) // d + (a - 1) // l
    
print(x - y)

### FIXED CODE ###

import fractions

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

# cとdの最大公約数
g = fractions.gcd(c, d)

# cとdの最小公倍数
l = c * d // g

# cとdで割り切れないb以下の数の個数
# (全体) - (cの倍数の個数) - (dの倍数の個数) + (cの倍数かつdの倍数の個数)
x = b - b // c - b // d + b // l

# cとdで割り切れない(a-1)以下の数の個数
y = (a - 1) - (a - 1) // c - (a - 1) // d + (a - 1) // l
    
print(x - y)
import numpy as np

n = int(input())
a = input().split()
s = ''

s = np.argsort(a)

for i in range(n):
	s[i] += 1 
s.strip("[")
s.strip("]")


print(s)


### FIXED CODE ###

n = int(input())
ans = []
A = list(map(int,input().split()))
A2 = [[0,i+1] for i in range(n)]

for i in range(n):
	A2[i][0] = A[i]
#print(A2)
A2 = sorted(A2,key = lambda x:x[0])

for i in range(n):
	ans.append(A2[i][1])
print(*ans)
a = int(input())
s = str(a)
c = 0
for i in range(len(s)-1):
    # print(c)
    if i%2 == 0:
        c += 10**(i+1) - 10**i 

if len(s) %2 == 1:
    c += int(s[1:])+1

print(c)


### FIXED CODE ###

a = int(input())
s = str(a)
c = 0
for i in range(len(s)-1):
    # print(c)
    if i%2 == 0:
        c += 10**(i+1) - 10**i 

if len(s) %2 == 1 and len(s)> 1:
    c += int(s[1:])+1 + (int(s[0])-1)*(10**(len(s)-1))
elif len(s)==1:
    c +=a

print(c)
n = int(input())
h = list(map(int, input().split()))

dp = []
for i in range(n):
    dp.append(-1)


def flog(m):
    if dp[m] != -1:
        return dp[m]
    if m == 0:
        dp[m] = 0
        return 0
    if m == 1:
        dp[m] = abs(h[0]-h[1])
        return dp[m]
    else:
        dp[m] = min(flog(m-1) + abs(h[m-1] - h[m]),flog(m-2) + abs(h[m-2] - h[m]))
        return dp[m]
  
print(flog(n-1))
  

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
 
dp = []
for i in range(n):
	dp.append(int(0))
dp[0] = 0
dp[1] = abs(h[0]-h[1])
 
for j in range(2,n):
	dp[j] = min(dp[j-1] + abs(h[j-1] - h[j]),dp[j-2] + abs(h[j-2] - h[j]))
  
print(dp[n-1])
#素因数分解
def prime_factorization(N):
    n=N
    a=2
    prime_factor=[]
    while a**2<=n:
        while n%a==0:
            prime_factor.append(a)
            n//=a
        a+=1
    if n>1:
        prime_factor.append(n)
    return prime_factor


# N=100
N=int(input())

a=1
b=N//a
dis=abs(a-b)

Li=prime_factorization(N)
# print(Li)

for p in range(2**len(Li)):
    bit=[]
    for e in range(len(Li)):
        if (p>>e)&1==1:
            bit.append(1)
        else:
            bit.append(0)
    # print(bit)
        proindex=[]
        for _ in range(len(bit)):
            if bit[_] ==1:
                proindex.append(_)
        _a=1
        for j in range(len(Li)**0.5):
            if proindex.count(j)==1:
                _a*=Li[j]
        _b=N//_a
        _dis=abs(_a-_b)
        if _dis<dis:
            a=_a
            b=_b
            dis=_dis
# print(a,b)

print(a-1+b-1)

### FIXED CODE ###

N=int(input())

a=1
b=N//a
dis=abs(b-a)

for i in range(1,int(N**0.5)+1):
    if N%i==0:
        _a=i
        _b=N//i
        _dis=abs(_b-_a)
        if _dis<dis:
            a=_a
            b=_b
            dis=_dis

print(a-1+b-1)
l, r = list(map(int,input().split()))
Set = set([l%2019])
for i in range(r-l):
	Set.add((l+1+i)%2019)
List = list(Set)
answer = (l * r) % 2019
k = 0
for i in range(len(List)):
	for j in range(len(List)):
		if(i < j):
			if(k == 0 or (i >= 45 and j >= 46))
				if(answer > (List[i] * List[j])% 2019):
					answer = (List[i] * List[j])% 2019
					k = 1
print(answer)

### FIXED CODE ###

l, r = list(map(int,input().split()))
lmod = l % 2019
rmod = r % 2019
if(r-l) >= 2018:
	answer = 0
elif(lmod > rmod):
	answer = 0
else:
	answer = (rmod * lmod)% 2019
	for i in range(rmod - lmod + 1):
		for j in range(rmod - lmod + 1):
			if(i < j):
				if(answer > (lmod + i) * (lmod + j) % 2019):
					answer = (lmod + i) * (lmod + j) % 2019
print(answer)
w=int(input())
l=[i+1 for i in range(w)]
n=int(input())
for _ in range(n):
    a,b=[int(i)-1 for i in input().split(",")]
    t=l[a]
    l[a]=l[b]
    l[b]=t
for i in w:
    print(i)


### FIXED CODE ###

w=int(input())
l=[i+1 for i in range(w)]
n=int(input())
for _ in range(n):
    a,b=[int(i)-1 for i in input().split(",")]
    t=l[a]
    l[a]=l[b]
    l[b]=t
for i in l:
    print(i)
A = int(input())
B = int(input())

if (A >= 1 and A <= 9) and (B >= 1 and B <= 9):
  print(A * B)
  
else:
  print(-1)

### FIXED CODE ###

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

if (A >= 1 and A <= 9) and (B >= 1 and B <= 9):
  print(A * B)
  
else:
  print(-1)
n,k = map(int, input().split())
array = list(map(int, input().split()))
one_tento:int = 0
for i in range(n-1):
    for j in range(i+1,n):
        if array[i] > array[j]:
            one_tento += 1
two_tento:int = 0
for i in range(n):
    for j in range(n):
        if array[i] > array[j]:
            two_tento += 1

result1:int = (one_tento * k) % (7 + 10**9)
result2:int = (two_tento * k * (k - 1) / 2) % (7 + 10**9)
result3:int = (result1 + result2) % (7 + 10**9)
print(int(result3))

### FIXED CODE ###

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

one_tento = 0
for i in range(n-1):
    for j in range(i+1,n):
        if array[i] > array[j]:
            one_tento += 1
one_tento = int(one_tento)

two_tento = 0
for i in range(n):
    for j in range(n):
        if array[i] > array[j]:
            two_tento += 1
two_tento = int(two_tento)

result1 = (one_tento * k) % (7 + 10**9)
result2 = ((two_tento % (7 + 10**9)) * ((k * (k - 1) // 2) % (7 + 10**9))) % (7 + 10 **9)
result3 = (result1 + result2) % (7 + 10**9)
print(int(result3))
import sys

S = input()

N = len(S)-1
sum = 0

for i in range(2**N):

    op = [""]*(N)
    for j in range(N):
        if (i>>j)&1:
            op[j] = "+"
    s = ""
    for j in range(N):
        s = s + S[j] + op[j]
    s = s + S[j]
    sum = sum + eval(s)
print(sum)

### FIXED CODE ###

import sys

S = list(input())

sum = 0
for i in range(2**(len(S)-1)):

    op_list = ['+']*(len(S)-1)

    for j in range(len(S)-1):
        if (i>>j) & 1:
            op_list[j] = ''


    s = ""
    for st_index in range(len(op_list)):
        s = s + S[st_index] + op_list[st_index]
    s = s + S[len(S)-1]
    result = eval(s)
    
    sum = sum + result

print(sum)
N = int(input())
s = [input() for i in range(N)]
from collections import Counter
s1 = sorted(s)
 
c = collections.Counter(s1)
s2 = c.most_common()
 
#print(s2)
a = 0
for i in range(len(s2)):
    if s2[0][1] == s2[i][1]:
        a = a + 1
 
for i in range(a):
    print(str(s2[i][0]))

### FIXED CODE ###

N = int(input())
s = [input() for i in range(N)]
import collections
s1 = sorted(s)
 
c = collections.Counter(s1)
s2 = c.most_common()
 
s3 = []
a = 0
for i in range(len(s2)):
    if s2[0][1] == s2[i][1]:
        s3.append(s2[i][0])
s4 = sorted(s3)
for i in range(len(s4)):
    print(s4[i])
import numpy as np

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

C = np.arange(A,B+1)

if len(C)>2*K:
    for i in range(A, A+K):
        print(i)
    for i in range(B-K+1,B+1):
        print(i)

else:
    for i in range(A,B+1):
        print(i)
        
        



### FIXED CODE ###

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

L = B - A + 1

if L >= 2*K:
    for i in range(A, A+K):
        print(i)
    for i in range(B-K+1,B+1):
        print(i)
        
else:
    for i in range(A,B+1):
        print(i)
array = list(map(int, input().strip().split()))
n = array[0]
backup = 0
for i in range(n):
    backup = array[i+1]
    array[i+1] = 0
    print(max(array))
    array[i+1] = backup

### FIXED CODE ###

n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

a_sort = sorted(set(a))

max_val_1 = a_sort[-1]
max_total_1 = a.count(max_val_1)

if len(a_sort) >= 2:
    max_val_2 = a_sort[-2]

#print("max val:{}".format(max_val_1))
#print("max total:{}".format(max_total_1))

for i in range(n):
    if max_total_1 >=2:
        print(max_val_1)
    
    elif a[i] < max_val_1:
        print(max_val_1)

    elif a[i] == max_val_1 and max_total_1 == 1:
        print(max_val_2)
    else:
        print("err")
# coding: utf-8

x = int(input())
for i in range(-100, 100):
    for j in range(i,1000):
        #print(j**5-i**5)
        if j**5-i**5 == x:
            ans = [j,i]
            break

print(ans)

### FIXED CODE ###

# coding: utf-8

x = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

D = make_divisors(x)
for i in D:
    for j in range(-10000,10000):
        k = j +  i
        if k**5 - j**5 == x:
            a, b = k, j
            break

print(a,b)
X = input()
A = ["Sunny","Cloudy","Rainy"]
N = (index(x) + 1) % 3
print(A.[N])

### FIXED CODE ###

x = input()
A = ["Sunny","Cloudy","Rainy"]
N = (A.index(x) + 1) % 3
print(A[N])
import math
x,y = map(int,input().split())
if (2*x-y)% 3 == 0 and (2*y-x)% 3 == 0:
	n = (2*y-x)/3
	m = (2*x-y)/3
	p = m/n
	print(int(pow(1+p,n)*pow(1+1/p,m)*math.sqrt((n+m)/(n*m))/math.sqrt(2*math.pi))%(pow(10,9)+7))
#	print(int(math.factorial(n+m)/(math.factorial(n)*math.factorial(m)))%(pow(10,9)+7))
else:
	print(0)

### FIXED CODE ###

import math
x,y = map(int,input().split())
mod = pow(10,9)+7
if (2*x-y)% 3 != 0 or (2*y-x)% 3 != 0 or ((2 * y - x) / 3 < 0) or ((2 * x - y) / 3 < 0):
	print(0)
else:
	n = int((2 * y - x) / 3)
	m = int((2 * x - y) / 3)
	P = [1]*(n + m + 1)
	for i in range(1, n+m+1):
		P[i] = P[i-1]*i
		P[i] %= mod
	print((P[n+m]*pow(P[n],mod-2,mod)*pow(P[m],mod-2,mod)) % mod)
S=input()

for i in range(10000):
  if S[-6:]=="dreamer" or S[-6:]=="eraser":
    S=S[:-6]
  elif S[-5:]=="dream" or S[-5:]=="erase":
    S=S[:-5]
  else:
    pass
  if S=[]:
    print("YES")
    break
else:
  print("NO")

### FIXED CODE ###

S=input()

for i in range(100000):
  if S[-7:]=="dreamer":
    S=S[:-7]
  elif S[-6:]=="eraser":
    S=S[:-6]
  elif S[-5:]=="dream" or S[-5:]=="erase":
    S=S[:-5]
  else:
    pass
  if S=="":
    print("YES")
    break
else:
  print("NO")
a,p=int(input().split())
x=3*a+p
if x%2==0:
  print(x/2)
else:
  print((x-1)/2)

### FIXED CODE ###

a,p=map(int,input().split())
x=3*a+p
print(x//2)
K = input()
A = input()
B = input()

i = 1
r = i * K
while r <= B:
  if r >= A:
    print('YES')
  elif r < A:
    i += 1
    r =  i * K
  else:
    print('NO')

### FIXED CODE ###

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

for i in range(a,b + 1):
  if i % k == 0:
    print('OK')
    break
else:
  print('NG')
import math
N, X = map(int, input().split())
city = [X] + list(map(int, input().split()))
city_diff = [abs(city[i + 1] - city[i]) for i in range(N)]
import math
ans = city_diff[0]
for i in range(1, N, 1):
    ans = math.gcd(ans, city_diff[i])
print(ans)

### FIXED CODE ###

def gcd(x, y):
    if y > x:
        return gcd(y, x)
    elif x == 0:
        return 0
    else:
        z = x % y
        if z == 0:
            return y
        else:
            return gcd(y, z)

N, X = map(int, input().split())
city = [X] + list(map(int, input().split()))
city_diff = [abs(city[i + 1] - city[i]) for i in range(N)]
ans = city_diff[0]
for i in range(1, N, 1):
    ans = gcd(ans, city_diff[i])
print(ans)
import numpy as np

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

count = 0

for i in range(1,num+1):
    if i <= k-1:
        times = np.log2(10/i)
        times = int(times) +1
        count += (1/num) * (1/2)**times
    elif i >= k:
        count += (1/num)
print(count)

### FIXED CODE ###

import numpy as np

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

count = 0.

for i in range(1,num+1):
    if i <= k-1:
        times = np.log2(k/i)
        if times != int(times):
            times = int(times) +1
        else:
            times = int(times)
        count += (1/num) * (1/2)**times
    elif i >= k:
        count += 1/num
print(count)
a=A+B
b=A-B
c=A*B
if a>b and a>c:
  print(a)
  elif b>a and b>c:
    print(b)
    elif c>a and c>b
    print(c)

### FIXED CODE ###

i = list(map(int, input().split()))
a=i[0]+i[1]
b=i[0]-i[1]
c=i[0]*i[1]
if a>=b and a>=c:
  print(a)
elif b>=a and b>=c:
  print(b)
else:
  print(c)
import queue

def proceess(start_x,start_y):
    #insland = []
    #insland.append([start_x,start_y])
    new_island = queue.Queue()
    map[start_x][start_y] = 0
    new_island.put([start_x,start_y])
    while True:
        ob = new_island.get()
        x = ob[0]
        y = ob[1]
        print("x : " + str(x) + ", y : " + str(y))

        for i in [-1,0,1]:
            for j in [-1,0,1]:
                nx = x + i
                ny = y + j

                if nx >= 0 and ny >= 0 and nx < w and ny < h:
                    print(map[nx][ny])
                    if map[nx][ny] == 1:
                        #insland.append([nx,ny])
                        print("nx : " + str(nx) + ", ny : " + str(ny))
                        new_island.put([nx,ny])
                        map[nx][ny] = 0

        if new_island.empty():
            break

while True:
    map = []

    tmp = input().split(" ")
    w = int(tmp[0])
    h = int(tmp[1])

    if w == 1 and h == 1:
        break


    for j in range(h):
        nova = []
        arm = input()
        for k in arm.split(" "):
            #k.rstrip('\n')
            nova.append(int(k))
        map.append(nova)

    print(map)

    count = 0
    for i in range(w):
        for j in range(h):
            if map[i][j] == 1:
                print("i : " + str(i) + ", j : " + str(j))
                proceess(i,j)
                count += 1

    print(count)



### FIXED CODE ###

import copy

move = ((1, 0), (0, 1), (0, -1), (-1, 0), (1, 1), (-1, -1), (-1, 1), (1, -1))


def dfs(start):
    field[start[1]][start[0]] = '0'
    CP = [start]
    while CP:
        NP = []
        for cp in CP:
            for m in move:
                n_p = (cp[0]+m[0], cp[1]+m[1])
                if not(n_p[0] < 0 or n_p[1] < 0 or n_p[1] >= h or n_p[0] >= w) and field[n_p[1]][n_p[0]] == '1':
                    field[n_p[1]][n_p[0]] = '0'
                    NP.append(n_p)
        CP = NP


while True:
    w, h = map(int, input().split())
    if w == 0 and h == 0:
        break
    field = [list(input().split()) for _ in range(h)]
    count = 0
    for y in range(h):
        for x in range(w):
            if field[y][x] == '1':
                dfs((x, y))
                count += 1
    print(count)
from sys import stdin
data = stdin.readlines()

a = int(data[0])
b = [int(s) for s in data[1].split()]

i = 0
ans = 1
while i <= a-1:
    ans = ans * b[i]
    i += 1
if ans > 10 ** 18:
    ans = -1

print(ans)

### FIXED CODE ###

from sys import stdin
data = stdin.readline().rstrip()

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

print(a * b)
n = int(input())
if n[-1] = 2, 4, 5, 7, 9:
  print("hon")
elsif n[-1] = 0, 1, 6, 8:
  print("pon")
else:
  print("bon")

### FIXED CODE ###

n = input()
if n[-1] in "24579":
  print("hon")
elif n[-1] in "0168":
  print("pon")
elif n[-1] in "3":
  print("bon")
n, m, k = map(int, input().split())

candidates = [0] * n
friends = [0] * n
blocks = [0] * n
parent = [i for i in range(n + 1)]
sizes = [1] * (n + 1)

def root(x):
    global parent
    if parent[x] == x:
        return x
    else:
        parent[x] = root(parent[x])
        return parent[x]

def unite(x, y):
    global parent
    global sizes
    x = root(x)
    y = root(y)
    # print(x, y)
    if x == y:
        return
    parent[y] = x # ここがREの原因らしいが..
    sizes[x] += sizes[y]
    # sizes[y] = sizes[x]

def same(x, y):
    return root(x) == root(y)

for _ in range(m):
    a, b = map(int, input().split())
    friends[a - 1] += 1
    friends[b - 1] += 1
    unite(a - 1, b - 1)

for _ in range(k):
    c, d = map(int, input().split())
    if same(c - 1, d - 1):
        blocks[c - 1] += 1
        blocks[d - 1] += 1

for i in range(n):
    candidates[i] = sizes[root(i)] - friends[i] - blocks[i] - 1

print(*candidates)


### FIXED CODE ###

class UnionFind:
    def __init__(self, n):
        self.parents = [i for i in range(n + 1)]
        self.sizes = [1] * (n + 1)

    def find(self, x):
        if self.parents[x] == x:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if y < x:
            x, y = y, x
        self.parents[y] = x
        self.sizes[x] += self.sizes[y]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def size(self, x):
        return self.sizes[self.find(x)]


n, m, k = map(int, input().split())
uf = UnionFind(n)
friends = [0] * n
blocks = [0] * n
for i in range(m):
    a, b = map(int, input().split())
    friends[a - 1] += 1
    friends[b - 1] += 1
    uf.unite(a - 1, b - 1)
for i in range(k):
    c, d = map(int, input().split())
    if uf.same(c - 1, d - 1):
        blocks[c - 1] += 1
        blocks[d - 1] += 1
ans = [0] * n
for i in range(n):
    ans[i] = uf.size(i) - friends[i] - blocks[i] - 1
print(*ans)
N = input()
# N = 86


def f(n):
    if n == 0:
        return 2
    elif n == 1:
        return 1
    elif n == 2:
        return 3
    return 2 * f(n - 2) + f(n - 3)


def g(n):
    L = [0] * (n + 1)
    L[0] = 2
    L[1] = 1
    for i in range(2, n + 1):
        L[i] = L[i - 1] + L[i - 2]

    return L[-1]


print(g(N))


### FIXED CODE ###

N = int(input())
# N = 86


def f(n):
    if n == 0:
        return 2
    elif n == 1:
        return 1
    elif n == 2:
        return 3
    return 2 * f(n - 2) + f(n - 3)


def g(n):
    L = [0] * (n + 1)
    L[0] = 2
    L[1] = 1
    for i in range(2, n + 1):
        L[i] = L[i - 1] + L[i - 2]

    return L[-1]


print(g(N))
tmp=input().split()
n=int(tmp[0])
d=int(tmp[1])
xn = [0]*n
num = 0

for i in range(n):
  xn[i] = input().split()
    
for i in range(n):
  for j in range(i+1, n):
    dist = 0
    for k in range(d):
      dist = dist + pow(int(xn[i][k])-int(xn[j][k]), 2)
#    print("test",dist)
#    print(int(pow(int(pow(dist,0.5)), 2)))
    if dist == int(pow(int(pow(dist,0.5)), 2)):
      num += 1
print(num)
                
    

### FIXED CODE ###

tmp=input().split()
n=int(tmp[0])
a=int(tmp[1])
b=int(tmp[2])

if a*n < b:
  print(a*n)
else:
  print(b)
a,b,k=map(int,input().split())
ans=[]

if i in range(1,min(a,b)+1):
  if a % i == 0 and b % i == 0:
    ans.append(i)

print(ans[-k])

### FIXED CODE ###

a,b,k=map(int,input().split())
ans=[]

for i in range(1,min(a,b)+1):
  if a % i == 0 and b % i == 0:
    ans.append(i)

print(ans[-k])
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
aa,bb=[0],[0]
for i in range(n):
    aa.append(aa[-1]+a[i])
for i in range(m):
    bb.append(bb[-1]+b[i])
ans,j=0,m
for i in range(n+1):
    if a[i]>k:
        break
    while b[j]>k-a[i]:
        j-=1
    ans=max(ans,i+j)
print(ans)

### FIXED CODE ###

n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
aa,bb=[0],[0]
for i in range(n):
    aa.append(aa[-1]+a[i])
for i in range(m):
    bb.append(bb[-1]+b[i])
ans,j=0,m
for i in range(n+1):
    if aa[i]>k:
        break
    while bb[j]>k-aa[i]:
        j-=1
    ans=max(ans,i+j)
print(ans)