Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(10**9)

n = int(input())
edges = [[] for _ in range(n)]
for _ in range(n - 1):
  a, b = map(int, input().split())
  edges[a - 1].append(b - 1)
  edges[b - 1].append(a - 1)


vertice = [0 for _ in range(n)]


def dfs(v, color_i):
    vertice[v] = color_i
    for i in edges[v]:
        if vertice[i] == 0:
            dfs(i, color_i*(-1))

dfs(0, 1)

ans = []
if vertice.count(1) <= n // 3:
    not3 = [i for i in range(1, n+1) if i % 3 != 0]
    num3 = [i for i in range(1, n+1) if i % 3 == 0]
    for v in vertice:
        if v == 1:
            if num3:
                ans.append(str(num3.pop()))
                continue
        ans.append(str(not3.pop()))
elif vertice.count(-1) <= n // 3:
    not3 = [i for i in range(1, n+1) if i % 3 != 0]
    num3 = [i for i in range(1, n+1) if i % 3 == 0]
    for v in vertice:
        if v == -1:
            if num3:
                ans.append(str(num3.pop()))
                continue
        ans.append(str(not3.pop()))
else:
    num1 = [i for i in range(1, n+1) if i % 3 == 1]
    num2 = [i for i in range(1, n+1) if i % 3 == 2]
    num3 = [i for i in range(1, n+1) if i % 3 == 0]
    for v in vertice:
        if v == 1:
            if num1:
                ans.append(str(num1.pop()))
            else:
                ans.append(str(num3.pop()))
        else:
            if num2:
                ans.append(str(num2.pop()))
            else:
                ans.append(str(num3.pop()))

print(" ".join(ans))


### FIXED CODE ###

n = int(input())
edge = [[] for _ in range(n)]
for _ in range(n-1):
  a, b = map(int, input().split())
  edge[a-1].append(b-1)
  edge[b-1].append(a-1)
 
group = [False] * n
parent = list(range(n))
stack = [0]
while stack:
  v = stack.pop()
  while edge[v]:
    u = edge[v].pop()
    if parent[v] != u:
      group[u] = not group[v]
      parent[u] = v
      stack.append(u)
 
three = 3
p = [0] * n
if group.count(False) <= n // 3:
  other = 1
  for i in range(n):
    if group[i] and other <= n:
      p[i] = other
      other += other % 3
    else:
      p[i] = three
      three += 3
elif group.count(True) <= n // 3:
  other = 1
  for i in range(n):
    if not group[i] and other <= n:
      p[i] = other
      other += other % 3
    else:
      p[i] = three
      three += 3
else:
  one, two = 1, 2
  for i in range(n):
    if group[i] and one <= n:
      p[i] = one
      one += 3
    elif not group[i] and two <= n:
      p[i] = two
      two += 3
    else:
      p[i] = three
      three += 3
print(' '.join(map(str, p)))
a,b,c,d,e,f=map(int,input().split())
l=[0]
ans=[[0,0]]
v=f//(100*a)
m=int(f*e/100)
for i in range(int(v+1)):
  w=(f-100*i)//(100*b)+1
  for j in range(w+1):
    for k in range(0,m//c+1,c):
      for n in range(0,(m-k*c)//d+1,d):
        X=100*a*i+100*b*j
        Y=k*c+n*d
        elif X+Y==0 or X+Y>f:
          continue
        else:
          p=100*Y/(X+Y)
          mp=100*e/(100+e)
          if p<=mp:
            if p>max(l):
              l.append(p)
              ans.append([X+Y,Y])
              flag=1
            else:
              continue
          else:
            continue
print(ans[-1][0],ans[-1][1])

### FIXED CODE ###

a,b,c,d,e,f=map(int,input().split())
x=set()
y=set()
m=f//(100*a)
for i in range(m+1):
  for j in range(f//(100*b)+1):
    x1=i*100*a+j*100*b
    if x1<=f:
      x.add(x1)

m=int(f*(e/100))
for i in range(0,m+1,c):
  for j in range(0,m-i+1,d):
     y.add(i+j)
x.remove(0) 
z=[-1]
ans=[]
for i in x:
  for j in y:
    if i+j<=f and j*100/(i+j)<=e*100/(100+e):
      if j*100/(i+j)>max(z):
        z.append(j*100/(i+j))
        ans.append([i+j,j])
        
print(ans[-1][0],ans[-1][1])
#!/usr/bin/env python3
import time


def main():
    from scipy.special import comb

    N = int(input())
    A = [int(x) for x in input().split()]
    # N = 10 ** 4
    # A = [int(x) for x in range(N)]

    num_lst = [0] * (N + 1)
    for a in A:
        num_lst[a] += 1

    cnt_lst = []
    for num in num_lst:
        cnt_lst.append(comb(num, 2, exact=True))

    for i in range(N):
        now = A[i]
        res = num_lst[now] - 1
        print(sum(cnt_lst[:now])
              + sum(cnt_lst[now + 1:])
              + (comb(res, 2, exact=True) if res >= 2 else 0))
    # print(num_lst)
    # print(cnt_lst)


if __name__ == '__main__':
    start = time.time()
    main()
    elapsed_time = time.time() - start
    # print(f'{elapsed_time:6f}', '[sec]')


### FIXED CODE ###

#!/usr/bin/env python3
def main():
    import time

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

    num_lst = [0] * (N + 1)
    for a in A:
        num_lst[a] += 1

    ans = 0
    for num in num_lst:
        # ans += comb(num, 2, exact=True)
        ans += num * (num - 1) // 2

    start = time.time()
    for a in A:
        print(ans - (num_lst[a] - 1))
    end = time.time() - start
    # print(f'{end:6f}', 's')


if __name__ == '__main__':
    main()
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	if i % 2 == n % 2:
		b.insert(0, a[i])
	else:
		b.append(a[i])

for x in b:
	print(x, end=' ')
print()

### FIXED CODE ###

from collections import deque
d = deque()
n = int(input())
a = input().split()

for i in range(n):
	if i % 2 == n % 2:
		d.append(a[i])
	else:
		d.appendleft(a[i])

print(' '.join(d))
import sys
from collections import defaultdict
from copy import deepcopy

input = sys.stdin.readline
N, M = list(map(int, input().split()))

PY = []
for _ in range(M):
    PY.append(list(map(int, input().split())))

sorted_PY = deepcopy(PY)
sorted_PY.sort(key=lambda x: x[1])

p_count_dict = defaultdict(lambda: 0)
y_dict = {}

for py in sorted_PY:
    p_count_dict[py[0]] += 1
    y_dict[py[1]] = p_count_dict[py[0]]

for py in PY:
    print(f'{py[0]:0>6}{y_dict[py[1]]:0>6}')


### FIXED CODE ###

import sys
from collections import defaultdict
from copy import deepcopy

input = sys.stdin.readline
N, M = list(map(int, input().split()))

PY = []
for _ in range(M):
    PY.append(list(map(int, input().split())))

sorted_PY = deepcopy(PY)
sorted_PY.sort(key=lambda x: x[1])

p_count_dict = defaultdict(lambda: 0)
y_dict = {}

for py in sorted_PY:
    p_count_dict[py[0]] += 1
    y_dict[py[1]] = p_count_dict[py[0]]

for py in PY:
    # print(f'{py[0]:0>6}{y_dict[py[1]]:0>6}')
    print('{}{}'.format(str(py[0]).zfill(6), str(y_dict[py[1]]).zfill(6)))
from heapq import *
def min_cost_flow_dijkstra(E, s, t, f):
    NN = 2 * N + 6
    G = [[] for _ in range(NN)]
    for a, b, cap, c in E:
        G[a].append([b, cap, c, len(G[b])])
        G[b].append([a, 0, -c, len(G[a])-1])
    prevv = [-1] * NN
    preve = [-1] * NN
    h = [0] * NN
    res = 0
    while f > 0:
        dist = [1<<100] * NN
        dist[s] = 0
        q = []
        heappush(q, s)
        while h:
            di, v = q.pop()
            if dist[v] < di: continue
            for i, (b, _cap, c, r) in enumerate(G[v]):
                if _cap > 0 and dist[b] > dist[v] + c + h[v] - h[b]:
                    dist[b] = dist[v] + c + h[v] - h[b]
                    prevv[b] = v
                    preve[b] = i
                    heappush(q, (dist[b], b))
        
        
        if dist[t] == 1<<100:
            return -1
        for v in range(NN):
            h[v] += dist[v]
        
        d = f
        v = t
        while v != s:
            d = min(d, G[prevv[v]][preve[v]][1])
            v = prevv[v]
        f -= d
        res += d * h[t]
        v = t
        while v != s:
            G[prevv[v]][preve[v]][1] -= d
            G[v][G[prevv[v]][preve[v]][3]][1] += d
            v = prevv[v]
    return res

E = []
N = int(input())
su = 0
INF = 1 << 31
for i in range(N):
    x, y, cnt = map(int, input().split())
    E.append((2*N+4, i, cnt, 0))
    E.append((i, 2*N, cnt, x + y + INF))
    E.append((i, 2*N+1, cnt, x - y + INF))
    E.append((i, 2*N+2, cnt, - x + y + INF))
    E.append((i, 2*N+3, cnt, - x - y + INF))
    su += cnt

for i in range(N):
    x, y, cnt = map(int, input().split())
    E.append((i+N, 2*N+5, cnt, 0))
    E.append((2*N, i+N, cnt, - x - y + INF))
    E.append((2*N+1, i+N, cnt, - x + y + INF))
    E.append((2*N+2, i+N, cnt, x - y + INF))
    E.append((2*N+3, i+N, cnt, x + y + INF))

print(su * INF * 2 - min_cost_flow(E, 2*N+4, 2*N+5, su))

### FIXED CODE ###

from networkx import*
N = int(input())
G = MultiDiGraph()
for i in range(N):
    x, y, c = map(int, input().split())
    G.add_node(i, demand = -c)
    G.add_weighted_edges_from([(i, -1, x + y)], capacity = c)
    G.add_weighted_edges_from([(i, -2, x - y)], capacity = c)
    G.add_weighted_edges_from([(i, -3, -x + y)], capacity = c)
    G.add_weighted_edges_from([(i, -4, -x - y)], capacity = c)
for i in range(N):
    x, y, c = map(int, input().split())
    G.add_node(N + i, demand = c)
    G.add_weighted_edges_from([(-1, N + i, -x - y)], capacity = c)
    G.add_weighted_edges_from([(-2, N + i, -x + y)], capacity = c)
    G.add_weighted_edges_from([(-3, N + i, x - y)], capacity = c)
    G.add_weighted_edges_from([(-4, N + i, x + y)], capacity = c)

print(-min_cost_flow_cost(G))
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
if a<10:
  if b<10:
    print(a*b)
    else:
      print(-1)
  else:
    print(-1)
     


### FIXED CODE ###

# -*- coding: utf-8 -*-
a, b = map(int, input().split())
if a<10 and b<10:
  print(a*b)
else:
  print(0-1)
k = int(input())
a,b=map(int, input().split())
for i in range(1,2000):
    x=k*i
    if a <= k and k <= b:
        print("OK")
        break
    else b < k:
        print("NG")
	break


### FIXED CODE ###

k = int(input())
a,b=map(int, input().split())
for i in range(1,2000):
    x=k*i
    if a <= x and x <= b:
        print("OK")
        break
    elif b < x:
        print("NG")
        break
li = lambda: list(map(int,input().split()))

n,l,t = li()
a,ac,au = [],[],[]
for i in range(n):
    x,y = li()
    if i == 0: start = y
    a.append(x)
    if y == 1:
        ac.append(x)
    else:
        au.append(x)

tt = t%l

if start == 2:
    acc = [n-ac[-s] for s in range(1,len(ac)+1)]
    dist = au[0]+acc[0]
    j = 0
    for i in range(1, min(len(au), len(acc))):
        if dist > tt:
            j = i-1
            break
        if i&1:
            dist += au[i]-au[i-1]
        else:
            dist += acc[i]-acc[i-1]
    if j&1:
        pointofone = n - acc[j//2]
    else:
        pointofone = au[j//2]
else:
    acc = [-au[0]] + [n-ac[-s] for s in range(1, len(ac))]
    dist = acc[0] + au[0]
    j = 0
    for i in range(1, min(len(ac), len(acc)) ):
        if dist > tt:
            j = i-1
            break
        if i&1:
            dist += acc[i]-acc[i-1]
        else:
            dist += au[i]-au[i-1]
    if j == 0:
        pointofone = ac[0]
    elif j&1:
        pointofone = au[j//2]
    else:
        pointofone = n - acc[j//2]

ant = sorted([(s-t)%l for s in au] + [(s+t)%l for s in ac])
st = ant.index(pointofone)
ant = ant[st:]+ant[:st]
print(*ant, sep='\n')

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
mode = 0
ans = 1
for i in range(1,n):
    d = a[i]-a[i-1]
    if mode == 0:
        mode = d
        continue
    if mode>0:
        if d<0:
            ans += 1
            mode = 0
    elif mode<0:
        if d>0:
            ans += 1
            mode = 0
print(ans)
a = input()
b = input()
c = input()
print(a[0]+b[1]+c[2]

### FIXED CODE ###

r0 = input()
r1 = input()
r2 = input()
print(r0[0],end='')
print(r1[1],end='')
print(r2[2],end='')
import sys
import numpy as np
from scipy.sparse.csgraph import shortest_path, dijkstra
from scipy.sparse import coo_matrix


def get_path(start, goal, pred):
    return get_path_row(start, goal, pred[start])


def get_path_row(start, goal, pred_row):
    path = []
    i = goal
    while i != start and pred_row[i] > 0:
        path.append(i)
        i = pred_row[i]
    if i < 0:
        return []
    path.append(i)
    return path[::-1]


read = sys.stdin.read
N, u, v, *AB = map(int, read().split())

a = AB[::2]
b = AB[1::2]
d = [1] * (N - 1)

graph = coo_matrix((d, (a, b)), shape=(N + 1, N + 1))
l, p = shortest_path(graph, directed=False, indices=u, return_predecessors=True)
dist = int(l[v]) // 2
s = get_path_row(u, v, p)[dist]
tour = shortest_path(graph, directed=False, indices=s)

print(int(max(i for i in tour if i != np.inf)) + dist - 1)

### FIXED CODE ###

import sys

read = sys.stdin.read
N, u, v, *AB = map(int, read().split())

graph = [[] for _ in range(N + 1)]
for a, b in zip(*[iter(AB)] * 2):
    graph[a].append(b)
    graph[b].append(a)


def dfs(v):
    dist = [-1] * (N + 1)
    stack = [v]
    dist[v] = 0
    while stack:
        v = stack.pop()
        dw = dist[v] + 1
        for w in graph[v]:
            if dist[w] >= 0:
                continue
            dist[w] = dw
            stack.append(w)
    return dist


DU, DV = dfs(u), dfs(v)

answer = 0
for u, v in zip(DU[1:], DV[1:]):
    if u < v:
        tmp = v - 1
        if answer < tmp:
            answer = tmp

print(answer)
# -*- coding: utf-8 -*-

a = input().split()
A = input().split()

for i in range(0, len(a)):
    a[i] = int(a[i])

for i in range(0, len(A)):
    A[i] = int(A[i])

count = 0
for i in range(0, a[2]):
    if(A[i] < a[2]):
        count = count + 1


if(count > (len(A) -  count)):
        count = len(A) -  count

print("{0}".format(count))


### FIXED CODE ###

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

a = input().split()
A = input().split()

for i in range(0, len(a)):
    a[i] = int(a[i])

for i in range(0, len(A)):
    A[i] = int(A[i])

count = 0
for i in range(0, len(A)):
    if(A[i] < a[2]):
        count = count + 1


if(count > (len(A) -  count)):
        count = len(A) -  count

print("{0}".format(count))
from collections import defaultdict
N, M = map(int, input().split())
Ai = list(map(int, input().split()))

for i in range(N):
    for j in range(i, N):
        t = 0
        for k in range(i, j + 1):
            t += Ai[k]

#-----------------
fact = [0 for _ in range(N + 1)]
fact[0] = 1
for i in range(1, N + 1):
    fact[i] = fact[i - 1] * i

def comb(n, m):
    return fact[n] // (fact[m] * fact[n - m])

#---------------
d = defaultdict(int)
total = Ai[0] % M
d[0] = 1
d[total] += 1
for i in range(1, N):
    total = (total + Ai[i]) % M
    d[total] += 1
#-----------------
ans = 0
for k in d.keys():
    c = d[k]
    if c >= 1:
        ans += comb(c, 2)
print(ans)

### FIXED CODE ###

from collections import defaultdict
N, M = map(int, input().split())
Ai = list(map(int, input().split()))

#---------------
d = defaultdict(int)
d[0] = 1
total = 0
for i in range(N):
    total = (total + Ai[i]) % M
    d[total] += 1
#-----------------
ans = 0
for k, c in d.items():
    if c > 1:
        ans += c * (c - 1) // 2
print(ans)
a = raw_input()
b = raw_input()
print a*b, (a+b)*2

### FIXED CODE ###

a,b=map(int,raw_input().split())
print a*b,(a+b)*2
a, b = map(int, input().split()
if a >= 10 or b >= 10:
    print(-1)
else:
    print(a*b)

### FIXED CODE ###

a, b = map(int, input().split())
if a >= 10 or b >= 10:
    print(-1)
else:
    print(a*b)
input()
V = [int(v) for v in input().split()]
count = 0
c1 = Counter(V[::2] + [0]).most_common()[0][0]
for v in V[::2]:
    if v != c1:
        count += 1
c2 = Counter(V[1::2] + [0]).most_common()
c2 = c2[0][0] if c1 != c2[0][0] else c2[1][0]
for v in V[1::2]:
    if v != c2:
        count += 1
print(count)

### FIXED CODE ###

from collections import Counter

input()
V = [int(v) for v in input().split()]
count1 = 0
count2 = 0
c11 = Counter(V[::2]).most_common()[0][0]
c12 = Counter(V[1::2]).most_common()[0][0]
for v1, v2 in zip(V[::2], V[1::2]):
    if v1 != c11:
        count1 += 1
    if v2 != c12:
        count2 += 1
c21 = Counter(V[1::2]).most_common()
c22 = Counter(V[::2]).most_common()
c21.append((0, 1))
c22.append((0, 1))
c21 = c21[0][0] if c21[0][0] != c11 else c21[1][0]
c22 = c22[0][0] if c22[0][0] != c12 else c22[1][0]
for v1, v2 in zip(V[1::2], V[::2]):
    if v1 != c21:
        count1 += 1
    if v2 != c22:
        count2 += 1
print(min(count1, count2))
n = int(input())

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

waru = 998244353

c = collections.Counter(d)

ans =1

cmax =max(c.keys())
if d[0] != 0:
    print(0)
else:
    for i in range(1,cmax+1):
        ans *= c[i-1]** c[i]

print(ans % waru)

### FIXED CODE ###


import collections

n = int(input())

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

waru = 998244353

c = collections.Counter(d)

ans =1

cmax =max(c.keys())
if d[0] != 0:
    print(0)
else:
    for i in range(1,cmax+1):
        if d[i] == 0:
            ans = 0
            break
        ans *= c[i-1]** c[i]

    print(ans % waru)
#import numpy as np

def FindMaxCon(res, water, C, D, E):
  c = 0
  d = 0
  tmpCon = 0
  dp = list([False] * 3001)
  dp[0] = True
  for i in range(3001):
    if(i - C >= 0 and i - D >= 0):
      dp[i] = dp[i - C] or dp[i - D]
    elif(i - C >= 0):
      dp[i] = dp[i - C]
    elif(i - D >= 0):
      dp[i] = dp[i - D]
  tmpSugar = 0
  for i in range(min(res, int(E * water / 100)) + 1):
    if(dp[i]):
      tmpSugar = i
  ans = tmpSugar
  return ans

A, B, C, D, E, F = (int(_) for _ in input().split())
amax = F / (A * 100)
bmax = F / (B * 100)
amax = int(amax)
bmax = int(bmax)
water = 0
sugar = 0
waterAns= 100 * A
sugarAns = 0
con = 0
conAns = 0
for a in range(1, amax + 1):
  for b in range(bmax + 1):
    water = 100 * (a * A + b * B)
    if(water > F):
      continue
    else:
      res = F - water
      tmp = FindMaxCon(res, water, C, D, E)
      sugar = tmp
      con = sugar / water
      if(con > conAns):
        conAns = con
        waterAns = water
        sugarAns = sugar
answer = str(waterAns + sugarAns) + " " + str(sugarAns)
print(answer)

### FIXED CODE ###

import numpy as np

N = int(input())
A = int(input())

print(N**2 - A)
import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N,K = [int(i) for i in input().split()]
for i in range(1,K+1):
    if (N-K+1)<i:
        print(0)
    print((combinations_count(N-K+1,i)*combinations_count(K-1,i-1))%(10**9+7))


### FIXED CODE ###

import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N,K = [int(i) for i in input().split()]
for i in range(1,K+1):
    if (N-K+1)<i:
        print(0)
        continue
    print((combinations_count(N-K+1,i)*combinations_count(K-1,i-1))%(10**9+7))
def f(x,y,z):
    n=x**2 + y**2 + z**2 + x*y + y*z + z*x
    return n

N=int(input())

if N>=9900:
  print(aaa)

anslist=[0]*60100

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            n= f(x,y,z)
            anslist[n-1]+=1

for i in range(N):
    print(anslist[i])


### FIXED CODE ###

def f(a,b,c):
    n=(a+b+c)**2 -a*b -b*c -c*a
    return n

N=int(input())

anslist=[0]*1000005

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            n= f(x,y,z)
            anslist[n-1]+=1

for i in range(N):
    print(anslist[i])
while 1:
    i = input().split()
    if i == None:
        break
    else:
        a, b, c, d, e, f = map(float, i)
        x = (e*c - b*f)/(e*a - b*d)
        y = (c*d - f*a)/(d*b - e *a)

        print(x,y) 

### FIXED CODE ###

while(True):
        try:
            a,b,c,d,e,f=map(float,input().split(" "))
            z=a*e-b*d
            if(z!=0):
                x=(c*e-b*f)/z
                y=(a*f-c*d)/z
            print("{:.3f} {:.3f}".format(x+0,y+0))
        except:
            break
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(n)]

for a, b in ab:
    ans = 10 ** 10
    dist = 10 ** 10
    for i in range(n):
        c, d = cd[i]
        temp = abs(a - c) + abs(b - d)
        if dist > temp:
            dist = temp
            ans = i + 1
    print(ans)


### FIXED CODE ###

n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(m)]

for a, b in ab:
    ans = 10 ** 10
    dist = 10 ** 10
    for i in range(m):
        c, d = cd[i]
        temp = abs(a - c) + abs(b - d)
        if dist > temp:
            dist = temp
            ans = i + 1
    print(ans)
import sys
input = lambda: sys.stdin.readline().rstrip() 

def resolve():
    N, M, K = map(int, input().split())
    A = [0]*M
    B = [0]*M
    for i in range(M):
        A[i], B[i] = map(int, input().split())
    C = [0]*K
    D = [0]*K
    for i in range(K):
        C[i], D[i] = map(int, input().split())

    par = list(range(N))

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

    ans = [0]*N

    for i in range(M):
        rA = root(A[i]-1)
        rB = root(B[i]-1)
        if rA != rB:
            par[rB] = rA

    for i in range(N):
        # 間接的友達を全列挙
        indirect_friends = [j+1 for j in range(N) if root(i)==root(j)]
        # その中から自分と直接の友達とブロック関係を除去
        direct_friends = set()
        blocked = set()
        for a, b in zip(A, B):
            if a == i+1:
                direct_friends.add(b)
            if b == i+1:
                direct_friends.add(a)
        for c, d in zip(C, D):
            if c == i+1:
                blocked.add(d)
            if d == i+1:
                blocked.add(c)
        candidate_friends = [j for j in indirect_friends if j!=i+1 and (not j in direct_friends) and (not j in blocked)]
        ans[i] = len(candidate_friends)

    print(*ans)

if __name__ == '__main__':
    resolve()


### FIXED CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10000)

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

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

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]
        
def resolve():
    N, M, K = map(int, input().split())
    A = [0]*M
    B = [0]*M
    for i in range(M):
        A[i], B[i] = map(int, input().split())
    C = [0]*K
    D = [0]*K
    for i in range(K):
        C[i], D[i] = map(int, input().split())

    uf = UnionFind(N)
    for a, b in zip(A, B):
        uf.union(a-1, b-1)

    direct_friends_num = [0]*N
    for a, b in zip(A, B):
        direct_friends_num[a-1] += 1
        direct_friends_num[b-1] += 1
    blocked_num = [0]*N
    for c, d in zip(C, D):
        if uf.find(c-1) == uf.find(d-1):
            blocked_num[c-1] += 1
            blocked_num[d-1] += 1

    ans = [0]*N
    for i in range(N):
        ans[i] = uf.size(i) - direct_friends_num[i] - blocked_num[i] - 1
    print(*ans)

if __name__ == '__main__':
    resolve()
a,b,c=map(int,input().split())
print(len(set([a,b,c])))

### FIXED CODE ###

a,s,c=map(str,input().split())
print(("A"+s[0]+"C"))