Harryxun/stf_run huggingface dataset:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)
MOD = 10 ** 9 + 7

class Factorial:
    def __init__(self, n, mod):
        self.f = [1]
        self.mod = mod
        for j in range(1, n + 1):
            self.f.append(self.f[-1] * j % mod)
        self.i = [pow(self.f[-1], mod - 2, mod)]
        for j in range(n, 0, -1):
            self.i.append(self.i[-1] * j % mod)
        self.i.reverse()
    def factorial(self, j):
        return self.f[j]
    def ifactorial(self, j):
        return self.i[j]
    def comb(self, n, k):
        return self.f[n] * self.i[n - k] % self.mod * self.i[k] % self.mod if n >= k else 0




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

lst = [-1] * (N + 1)
for i in range(N):
    a = A[i]
    if lst[a] == -1:
        lst[a] = i
    else:
        left = lst[a]
        right = i
        break
# print (left, right)
F = Factorial(N + 1, MOD).comb

for i in range(1, N + 2):
    tmp = F(N + 1, i) - F(left + (N- right), i - 1)
    
    print (tmp % MOD)






### FIXED CODE ###

MOD = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
lst = [-1] * n

# O(N)
for i in range(n + 1):
    if lst[a[i] - 1] != -1:
        first = lst[a[i] - 1]
        second = i
        break
    lst[a[i] - 1] = i

# print (first, second)    
left = first
right = n - second

U = 10 ** 5 + 1
def power_mod(a, n):
    if n == 0:
        return 1
    x = power_mod(a//2)

def make_fact(fact, fact_inv):
    for i in range(1, U + 1):
        fact[i] = (fact[i - 1] * i) % MOD
    fact_inv[U] = pow(fact[U], MOD - 2, MOD)
    for i in range(U, 0, -1):
        fact_inv[i - 1] = (fact_inv[i] * i) % MOD

def comb(n, k):
    if k < 0 or n < k:
        return 0
    x = fact[n]
    x *= fact_inv[k]
    x %= MOD
    x *= fact_inv[n - k]
    x %= MOD
    return x

fact = [1] * (U + 1)
fact_inv = [1] * (U + 1)
make_fact(fact, fact_inv)

for i in range(1, n + 2):
    ans = comb(n + 1, i) - comb(left + right, i - 1)
    print (ans % MOD)
M=10**9+7;F=[pow(X,M-2,M)for X in range(2*10**5)];H,W,A,B=map(int,input().split());Z=C=1
for I in range(H-1):Z=C=C*(W+H-B-2-I)*F[I+1]%M
for I in range(1,H-A):C=C*(B-1+I)*F[I]*(H-I)*F[W+H-B-1-I]%M;Z=(Z+C)%M
print(Z)

### FIXED CODE ###

print('YES' if sorted(input().split()) == ['5', '5', '7'] else 'NO')
K,X=map(int,input().split())
if(500*K>=X):
  print("Yes")
else:
  print("No)

### FIXED CODE ###

K,X=map(int,input().split())
if(500*K>=X):
  print("Yes")
else:
  print("No")
N=int(input())
a=[]
b=[]
for i in range(N):
  a=a.append(float(input()))
  b=b.append(input())
total=0
j=0
while j<N:
  if b[j]='JPY':
    total = total+ a[j]
  else:
    total = total+380000.0*a[j]
  j+=1

print(total)


### FIXED CODE ###

N=int(input())
a=[]
b=[]
for i in range(N):
  x,y=input().split()
  a.append(float(x))
  b.append(y)
total=0
for j in range(N):
  if b[j]=='JPY':
    total += a[j]
  else:
    total += 380000.0*a[j]
print(total)
a = int(input())
b = int(input())
menseki = a*b
nagasa = a+a+b+b
print(menseki,nagasa)

### FIXED CODE ###

a,b=[int(i) for i in input().split()]
print(a*b,(a+b)*2)
N,M = map(int,input().split())
m = 0
v = input().split()
for i in range(N): v[i] = int(v[i])
  
v.sort(reverse=True)
v_min = sum(v)/4/M

while v.pop(0) >= v_min:
  m += 1

if M <= m:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N,M = map(int,input().split())
m = 0
v = input().split()
for i in range(N): v[i] = int(v[i])
  
v.sort(reverse=True)
v_min = sum(v)/4/M

while len(v):
  if v.pop(0) >= v_min:
    m += 1
  else:
    break

if M <= m:
  print("Yes")
else:
  print("No")
n = int(input())
s = input()..split()
for i in (reversed(s)):
    print(i)


### FIXED CODE ###

n = int(input())
s = input().split()
s.reverse()
print(' '.join(s))
mojiretu="abcdefghijklmnopqrstuvwxy"
C=input()
for i in range(25):
    if mojiretu[i]==C:
        print(mojiretu[i+1])

### FIXED CODE ###

mojiretu="abcdefghijklmnopqrstuvwxyz"
C=input()
for i in range(25):
    if mojiretu[i]==C:
        print(mojiretu[i+1])
A, B, C = map(int, input().split())

Number=0
count =0

for i in range (51):
    MAX=max(A,B,C)
    Number=0
    if MAX==A:
        Number=Number+1
    if MAX==B:
        Number=Number+1
    if MAX==C:
        Number=Number+1

    if Number ==1:
        MAX=max(A,B,C)
        if MAX!=A:
            A=A+1
        if MAX!=B:
            B=B+1
        if MAX!=C:
            C=C+1
        count=count +1
        Number=0

    if Number ==2:
        MAX=max(A,B,C)
        if MAX!=A:
            A=A+2
        if MAX!=B:
            B=B+2
        if MAX!=C:
            C=C+2
        count=count +1
        Number=0
    
    if Number ==3:
        print('%d'%(count))
        break

### FIXED CODE ###

S = input()

S1='abc'
S2='acb'
S3='bac'
S4='bca'
S5='cab'
S6='cba'
if S==S1:
    print ('Yes')
elif S==S2:
    print ('Yes')
elif S==S3:
    print ('Yes')
elif S==S4:
    print ('Yes')
elif S==S5:
    print ('Yes')
elif S==S6:
    print ('Yes')
else:
    print ('No')
while b!=0:
    a,b=b,a%b
  return a

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

c1=B//C
c2=(A-1)//C

cd1=B//((C*D)/gcd(C,D))
cd2=(A-1)//((C*D)/gcd(C,D))

d1=B//D
d2=(A-1)//D


print(int(B-A+1-(c1-c2)-(d1-d2)+(cd1-cd2)))


### FIXED CODE ###

def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

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

c1=B//C
c2=(A-1)//C

cd1=B//((C*D)//gcd(C,D))
cd2=(A-1)//((C*D)//gcd(C,D))

d1=B//D
d2=(A-1)//D


print(str(int(B-A+1-(c1-c2)-(d1-d2)+(cd1-cd2))))
import sys
def side(p1, p2, p3): return (p3[1]-p1[1])*(p2[0]-p1[0])-(p2[1]-p1[1])*(p3[0]-p1[0])>0
 
for s in sys.stdin:
  x = map(float, raw_input().split())
  p1 = x[0:2]
  p2 = x[2:4]
  p3 = x[4:6]
  p0 = x[6:]
  print ["NO","YES"][(side(p1, p2, p0)==side(p2, p3, p0) and side(p2, p3, p0)==side(p3, p1, p0))]

### FIXED CODE ###

def side(p1, p2, p3):
    return (p3[1]-p1[1])*(p2[0]-p1[0])-(p2[1]-p1[1])*(p3[0]-p1[0])>0

while True:
    try:
        x = map(float, raw_input().split())
        p1 = x[0:2]
        p2 = x[2:4]
        p3 = x[4:6]
        p0 = x[6:]
        if (side(p1, p2, p0)==side(p2, p3, p0) and side(p2, p3, p0)==side(p3, p1, p0)):
            print "YES"
        else:
            print "NO"
    except:
        break
n,q=map(int,input().split())
ab=[[0]*2 for i in range(n-1)]
px=[[0]*2 for i in range(q)]
for i in range(n-1):
    ab[i][0],ab[i][1]=map(int,input().split())
for i in range(q):
    px[i][0],px[i][1]=map(int,input().split())
# print(ab)
# print(px)
node=[[0] for i in range(n+1)]
for i in range(n-1):
    node[ab[i][0]].append(ab[i][1])
for i in range(q):
    node[px[i][0]][0]+=px[i][1]
# print(node)
ans=[0]*(n+1)

def flow(n):
    # print(n)
    # print(node)
    # print(ans)
    # print(len(node[n]))
    ans[n]+=node[n][0]
    for i in range(1,len(node[n])):
        node[node[n][i]][0]+=node[n][0]
        flow(node[n][i])

flow(1)
# print(ans)

ans2=ans[1:]
# print(ans2)
print(" ".join(map(str,ans2)))

### FIXED CODE ###

import sys
from collections import deque
def input():
    return sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**7)
n,q=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(n-1)]
px=[list(map(int,input().split())) for i in range(q)]

# def denpan(oya,ko):
#     for i in range(len(ne[ko])):
#         if ne[ko][i]!=oya:
#             cnt[ne[ko][i]]+=cnt[ko]
#             denpan(ko,ne[ko][i])

ne=[[] for i in range(n+1)]
for i in range(n-1):
    ne[ab[i][0]].append(ab[i][1])
    ne[ab[i][1]].append(ab[i][0])
# print(ne)
cnt=[0]*(n+1)
for i in range(q):
    cnt[px[i][0]]+=px[i][1]
par=[-1]*(n+1)
stack=deque([1])
while(stack):
    v=stack.pop()
    for i in range(len(ne[v])):
        if ne[v][i]!=par[v]:
            cnt[ne[v][i]]+=cnt[v]
            par[ne[v][i]]=v
            stack.append(ne[v][i])
cnt.remove(0)
print(' '.join(map(str,cnt)))
while True:
	x = input()
	if x == 1:
  		print(0)
   		break
	elif x ==0:
  		print(1)
        break
    else:
      continue


### FIXED CODE ###

x = int(input())
if x == 1:
  print(0)
if x == 0:
  print(1)
a, b = map(int, input().split())
if a <= 0 and b >= 0:
    print("Zero")
elif a < 0 and b < 0:
    if len(list(range(a, b+1))) % 2:
        print("Negative")
else:
    print("Positive")

### FIXED CODE ###

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

if a <= 0 and b >= 0:
    print("Zero")

elif a < 0 and b < 0:
    if (abs(a)-abs(b+1))%2:
        print("Negative")
    else:
        print("Positive")

else:
    print("Positive")
from scipy.special import comb
x,y = map(float,input().split())
m = (2*x - y)/3
n = (y - m)/2
if (x + y) % 3 != 0:
  print(0)
else:
  print(comb(n + m,n,exact=True)%(10**9+7))

### FIXED CODE ###

from operator import mul
from functools import reduce
import sys
x,y = map(float,input().split())
m = (2*x - y)/3
n = (y - m)/2
if not (m.is_integer() and n.is_integer()):
  print(0)
  sys.exit()
if n < 0 or m < 0:
  print(0)
  sys.exit()
m = int(m)
n = int(n)
mod = 10**9 + 7
def cmb(h, r):
    if h - r < r: r = h - r
    if r == 0: return 1
    if r == 1: return h
    r = int(r)

    humerator = [h - r + k + 1 for k in range(r)]
    dehominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = dehominator[p - 1]
        if pivot > 1:
            offset = (h - r) % p
            for k in range(p-1,r,p):
                k = int(k)
                offset = int(offset)
                humerator[k - offset] /= pivot
                dehominator[k] /= pivot

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

    return result
if (x + y) % 3 != 0:
  print(0)
else:
  print(cmb(n + m,n)%mod)
S = input()

len_now = len(S)
count = 0
pivot = len(S)-1

while True:
  if len(S)==1:
    break
  elif S[0]=="1" and S[1]=="1":
    break
  elif S[0]=="0" and S[1]=="0":
    break
  
  if S[pivot]=="0" and S[pivot+1]=="1":
    S = S[pivot+2:len(S)]
    count = count + 2
  elif S[pivot]=="1" and S[pivot+1]=="0":
    S = S[pivot+2:len(S)]
    count = count + 2
  pivot = pivot+1

print(count)

### FIXED CODE ###

S = input()


count_1 = 0
count_0 = 0

for i in range(len(S)):
  if S[i]=="1":
    count_1 = count_1 + 1
  elif S[i]=="0":
    count_0 = count_0 + 1
    

if count_1 >= count_0:
  print(count_0*2)
else:
  print(count_1*2)
import sys

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

for i in range(0, N, 1):
	if A[i] == A[i + 1]:
		print("NO")
		sys.exit(0)

print("YES")

### FIXED CODE ###

import sys

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

for i in range(0, N - 1, 1):
	if A[i] == A[i + 1]:
		print("NO")
		sys.exit(0)

print("YES")
def func():

    n = int(input())
    data = []
    for i in range(n):
        data.append(list(map(int,input().split())))




    for cx in range(101):
        for cy in range(101):
            for line in data:
                if data[2] != 0:
                    x = data[i][0]
                    y = data[i][1]
                    h = data[i][2]
                    H_max = h + abs(cx - x) + abs(cy - y)
            flag = True
            for i in range(n):
                    x = data[i][0]
                    y = data[i][1]
                    h = data[i][2]
                    if h != 0:
                        if not H_max == h + abs(cx-x) + abs(cy-y):
                            flag = False
                            break
                    else:
                        if not H_max <=  abs(cx-x) + abs(cy-y):
                            flag = False
                            break
            if flag:
                print(cx,cy,H_max)
                return 0

func()



### FIXED CODE ###



def func():

    n = int(input())
    data = []
    for i in range(n):
        data.append(list(map(int,input().split())))

    for cx in range(101):
        for cy in range(101):
            for line in data:
                if line[2] != 0:
                    x = line[0]
                    y = line[1]
                    h = line[2]
                    H_max = h + abs(cx - x) + abs(cy - y)
                    break
            flag = True
            for i in range(n):
                    x = data[i][0]
                    y = data[i][1]
                    h = data[i][2]
                    if h != 0:
                        if not H_max == h + abs(cx-x) + abs(cy-y):
                            flag = False
                            break
                    else:
                        if not H_max <=  abs(cx-x) + abs(cy-y):
                            flag = False
                            break
            if flag:
                print(cx,cy,H_max)
                return 0

func()
import sys

n, x, *lst = map(int, sys.stdin.read().split())
re1 = 0
lst.append(0)
for i in range(n, 0, -1):
  tmpsum = lst[i] + lst[i - 1]
  if tmpsum > x:
    res += tmpsum - x
    lst[i - 1] -= tmpsum - x

print(res)


### FIXED CODE ###

import sys

n, x, *lst1 = map(int, sys.stdin.read().split())
res1 = res2 = 0
lst2 = [0] + lst1
lst1.append(0)
for i in range(n):
  tmpsum = lst2[i] + lst2[i + 1]
  if tmpsum > x:
    res1 += tmpsum - x
    lst2[i + 1] -= tmpsum - x

for i in range(n, 0, -1):
  tmpsum = lst1[i] + lst1[i - 1]
  if tmpsum > x:
    res2 += tmpsum - x
    lst1[i - 1] -= tmpsum - x  
print(min(res1, res2))
import copy
H,W=map(int,input().split())
List = []
for i in range (H):
  List.append(input())
resList = copy.deepcopy(List)

def bombCheck(x,y,ListX):  
  a = 0
  b = 0
  res = 0
  if ListX[x][y] == "#":
    return "#"
  for i in range(-1,2,1):
    a = x+i
    if a<0 or a >= W:
      pass
    else:
      for j in range(-1,2,1):
        b = y+j
        if b<0 or b >= H:
          pass
        else:
          if i == 0 and j ==0:
            pass
          else:
            if List[a][b] == "#":
              res +=1
            else:
              pass
  return str(res)

for i in range(H):
  resList[i] =""
  for j in range(W):
    resList[i] += bombCheck(i,j,List)
for i in resList:
  print(i)

### FIXED CODE ###

import copy
H,W=map(int,input().split())
List = []
for i in range (H):
  List.append(input())
resList = copy.deepcopy(List)

def bombCheck(x,y,ListX):  
  a = 0
  b = 0
  res = 0
  if ListX[x][y] == "#":
    return "#"
  for i in range(-1,2,1):
    a = x+i
    if 0<= a < H:
      for j in range(-1,2,1):
        b = y+j
        if 0<= b < W:
          if i == 0 and j ==0:
            pass
          else:
            if List[a][b] == "#":
              res +=1
  return str(res)

for i in range(H):
  resList[i] =""
  for j in range(W):
    resList[i] += bombCheck(i,j,List)
for i in resList:
  print(i)
X = int(raw_input())

nmax = 100000

array = [0]*nmax
array[0] = 1

value_list = [100,101,102,103,104,105]

for i in range(nmax):
    for value in value_list:
        if i - value >= 0:
            if array[i-value] == 1:
                array[i] = 1

print array[X]


### FIXED CODE ###

X = int(raw_input())

nmax = 100000

array = [0]*(nmax+1)
array[0] = 1

value_list = [100,101,102,103,104,105]

for i in range(nmax+1):
    for value in value_list:
        if i - value >= 0:
            if array[i-value] == 1:
                array[i] = 1

print array[X]
print(int(input()**2*3))

### FIXED CODE ###

print(int(input())**2*3)
x = input()
x = x.split(" ")
x = [int(z) for z in x]
#y = x[1].split(" ")
#y = [int(z) for z in y]
cmax = ???1000000
cmin = 1000000
csum = 0
for z in x:
    if cmax < z:
        cmax = z
    if cmin > z:
        cmin = z
    csum += z
print("%d %d %d" % (cmin, cmax, csum))

### FIXED CODE ###

x = input()
x = input()
x = x.split(" ")
x = [int(z) for z in x]
cmax = -1000000
cmin = 1000000
csum = 0
for z in x:
    if cmax < z:
        cmax = z
    if cmin > z:
        cmin = z
    csum += z
print("%d %d %d" % (cmin, cmax, csum))
N = input().split()

list = [int(x) for x in input().split()]

sortlist = list.sorted()

answer = 1

for a in sortlist:
    answer = answer*a
    if answer == 0:
        break
    if answer > 10^18:
        answer = -1
        break
    else:
        continue


### FIXED CODE ###

N = input().split()

list = [int(x) for x in input().split()]

list.sort()

answer = 1

for a in list:
    answer = answer*a
    if answer == 0:
        break
    if answer > 10**18:
        answer = -1
        break
    else:
        continue

print(answer)
import collections
N,K=map(int,input().split())
A=list(map(int,input().split()))
B=collections.Counter(A).most_common()

print(sum(B[::-1][:K][i][1] for i in range(len(B)-K)))

### FIXED CODE ###

from collections import Counter
N,K=map(int,input().split())
A=input().split()
B=Counter(A)
C=sorted(B.values(),reverse=True)
print(sum(C[K:]))
import numpy as np
n = int(input())
a = [int(input()) for _ in range(n)]
t1 = max(a)
t1_idx = [i for i, v in enumerate(a) if v == t1]
a.sort()
t2 = t2 = a[-1*len(t1_idx)-1]
for i in range(n):
    if i in t1_idx:
        print(t2)
    else:
        print(t1)


### FIXED CODE ###

import numpy as np
n = int(input())
a = [int(input()) for _ in range(n)]
t1 = max(a)
t1_idx = [i for i, v in enumerate(a) if v == t1]
a.sort()

if len(t1_idx) < 2:
    try:
        t2 = a[-1*len(t1_idx)-1]
    except:
        for i in range(n):
            print(t1)

    for i in range(n):
        if i in t1_idx:
            print(t2)
        else:
            print(t1)
else:
    for i in range(n):
        print(t1)
s = input()
if s = 'AAA' or s =='BBB':
    print('No')
else:
    print('Yes')

### FIXED CODE ###

s = input()
if s == 'AAA' or s =='BBB':
    print('No')
else:
    print('Yes')
N = int(input())
X = input()
int_X = int(X, 2)

def bit_count(bits):
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >> 16 & 0x0000ffff);


def pop_counter(n):
    return n % bit_count(n)


ans = 0
for n, i in enumerate(X):
    ans = 0
    if i == '1':
        tmp = int_X - pow(2, N - 1 - n)
    else:
        tmp = int_X + pow(2, N - 1 - n)
    while tmp != 0:
        tmp = pop_counter(tmp)
        ans += 1
    print(ans)


### FIXED CODE ###

N = int(input())
X = input()
bin_X = int(X, 2)
cnt = 0
for i in X:
    if i == '1':
        cnt += 1


def bit_count(bits):
    cnt = 0
    while bits:
        bits = bits & (bits - 1)
        bits >> 1
        cnt += 1
    return cnt


def pop_counter(n):
    return n % bit_count(n)


ans = 0
xp = bin_X % (cnt + 1)
if cnt != 1:
    xm = bin_X % (cnt - 1)
else:
    xm = 0
for n, i in enumerate(X):
    if i == '0':
        tmp = xp + pow(2, N - n - 1, cnt + 1)
        tmp %= cnt + 1
    elif cnt != 1:
        tmp = xm - pow(2,N-n-1,cnt-1)
        tmp %= cnt -1
    else:
        print(0)
        continue
    ans = 1
    while tmp != 0:
        tmp = pop_counter(tmp)
        ans += 1
    print(ans)
#(問3)ANS
iter = map(int,input().split())
all_list = []
for i in iter:
    all_list.append(i)
N = all_list[0]
A_list = all_list[1:]

iter_num_list = []
for a in A_list:
    count = 0
    while a%2 == 0:
        a = a/2
        count += 1
    iter_num_list.append(count)
ans = min(iter_num_list)
print(ans)

### FIXED CODE ###

#(問3)ANS-1
import sys
lines = sys.stdin.readlines()
N = lines[0]
N = N.strip()
A = lines[1]
A_iter = map(int,A.split()) #イテレータを生成
A_list = []
for i in A_iter:
    A_list.append(i)

iter_num_list = []
for a in A_list:
    count = 0
    while a%2 == 0:
        a = a/2
        count += 1
    iter_num_list.append(count)
ans = sorted(iter_num_list)[0]
print(ans)
from collections import Counter
from math import factorial


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

s = [0]
s_elem = 0

for ai in a:
  
  s_elem += ai
  s.append(s_elem)

ans = 0
for c in Counter(s).values():
  if c > 1:
    ans += i*(i-1)//2
    
print(ans)

### FIXED CODE ###

from collections import Counter
from math import factorial


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

s = [0]
s_elem = 0

for ai in a:
  
  s_elem += ai
  s.append(s_elem)

ans = 0
for c in Counter(s).values():
  ans += c*(c-1)//2
    
print(ans)
from collections import defaultdict

friend_list = defaultdict(int)
for _ in range(M):
  AB = input().split()
  A = int(AB[0])-1
  B = int(AB[1])-1
  uf.combine(A,B)
  friend_list[A] += 1
  friend_list[B] += 1

block_list = defaultdict(int)
for _ in range(K):
  CD = input().split()
  C = int(CD[0])-1
  D = int(CD[1])-1
  if uf.in_the_same_group(C, D):
    block_list[C] += 1
    block_list[D] += 1

cnt = defaultdict(int)
ans = []
for i in range(N):
  cnt[i] = -uf.root[uf.find_root(i)] - 1 - friend_list[i] - block_list[i]
  ans.append(str(cnt[i]))

print(" ".join(ans))

### FIXED CODE ###

class UnionFind():
 def __init__(self,n):
   self.n=n
   self.root=[-1]*(n+1)
   self.rank=[0]*(n+1)
 def FindRoot(self,x):
   if self.root[x]<0:
     return x
   else:
     self.root[x]=self.FindRoot(self.root[x])
     return self.root[x]
 def Unite(self,x,y):
   x=self.FindRoot(x)
   y=self.FindRoot(y)
   if x==y:
     return
   else:
     if self.rank[x]>self.rank[y]:
       self.root[x]+=self.root[y]
       self.root[y]=x
     elif self.rank[x]<=self.rank[y]:
       self.root[y]+=self.root[x]
       self.root[x]=y
       if self.rank[x]==self.rank[y]:
         self.rank[y]+=1
 def isSameGroup(self,x,y):
   return self.FindRoot(x)==self.FindRoot(y)
 def Count(self,x):
   return -self.root[self.FindRoot(x)]
 
n,m,k=map(int,input().split())
t=UnionFind(n+1)
cnt=[0]*(n+1) #各iについて、iと同一の連結成分に属する友達関係の人、ブロック関係の人の数を数える
for _ in range(m):
 a,b=map(int,input().split())
 cnt[a]+=1 #各iについて、iと同一の連結成分に属する友達関係の人の数を数える
 cnt[b]+=1
 t.Unite(a,b)
for _ in range(k):
 a,b=map(int,input().split())
 if t.isSameGroup(a,b)==True:
   cnt[a]+=1 #各iについて、iと同一の連結成分に属するブロック関係の人の数を数える
   cnt[b]+=1
ans=[0]*(n+1)
for i in range(1,n+1):
 ans[i]=(t.Count(i)-1)-cnt[i] #答えは(各iが属する連結成分のサイズ)-1-((iと同一の連結成分に含まれているiと友達関係にある人の数)+(iと同一の連結成分に含まれているiとブロック関係にある人の数)となる
print(*ans[1:])
N=int(input())
keta=1
a=26
while N>a:
  a*=26
  keta+=1
ans=""
for i in range(keta-1,0,-1):
  a=N//(26**i)-1
  N=N%(26**i)
  ans+=chr(ord('a')+a)
ans+=chr(ord('a')+N//(26**i))
print(ans)

### FIXED CODE ###

N=int(input())
keta=1
a=26
ans=""
while N>0:
  N-=1
  ans+=chr(ord('a')+N%26)
  N=N//26
print(ans[::-1])
buri

### FIXED CODE ###

a,b=map(int,input().split())
if a % 2 != b % 2:
  print("IMPOSSIBLE")
else:
  print((a + b) // 2)
a = list(map(int,input().split()))
a = sort(a)
print(a[0]*a[1]//2)

### FIXED CODE ###

a = list(map(int,input().split()))
a = sorted(a)
print(a[0]*a[1]//2)
from collections import deque, defaultdict

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

for _ in range(M):
    v1, v2 = map(int, input().split())
    # if v1>v2: v1,v2 = v2,v1
    outs[v1].append(v2)
    outs[v2].append(v1)

#print(outs)
q = deque([1])
depth = defaultdict(int)
depth[1] = 0
visit = [False]*M #配列なので0オリジン
visit[0] = True

while q:
    v1 = q.popleft()
    for v2 in outs[v1]: #v1のノードから出ている矢印をみる．
        if visit[v2-1]==False:
            visit[v2-1] = True
            if depth[v2] == 0:
                depth[v2] = v1
            q.append(v2)
            print(v2,q,depth)

b = sorted(depth.items())
#print(b)
print("Yes")
for i in range(1,N):
    print(b[i][1])

### FIXED CODE ###

from collections import deque, defaultdict

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

for _ in range(M):
    v1, v2 = map(int, input().split())
    #v1, v2 = v1-1,v2-1
    outs[v1].append(v2)
    outs[v2].append(v1)

# print(outs)
q = deque([1])
depth = defaultdict(int)
depth[1] = 0
visit = [False]*N #配列なので0オリジン
visit[0] = True
# print(visit)
while q:
    v1 = q.popleft()
    # print("a",v1)
    for v2 in outs[v1]: #v1のノードから出ている矢印をみる．
        # print("b",v2)
        if visit[v2-1]==False:
            visit[v2-1] = True
            depth[v2] = v1
            q.append(v2)
            # print(v2,q,depth)

b = sorted(depth.items())
# print(b)
print("Yes")
for i in range(1,N):
    print(b[i][1])