CodeEff/ECCO huggingface dataset:
# Original solution
import sys
input = sys.stdin.readline
from collections import deque
import copy

N, M, K = list(map(int, input().split()))
friend = [deque() for _ in range(N)]
status = [-1]*N
numList = [0]*N

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

def DFS(graph, v, num):
    global numList
    cnt = 1
    stack = [v]
    status[v] = num
    while stack:
        v = stack[-1]
        if graph[v]:
            w = graph[v].popleft()
            if status[w] == -1:
                status[w] = num
                cnt += 1
                stack.append(w) 
        else:
            stack.pop() 
    numList[num] = cnt

cnt = 0
for i in range(N):
    if status[i] == -1:
        DFS(copy.deepcopy(friend), i, cnt)
        cnt += 1

ans = [0]*N
for i in range(N):
    ans[i] = numList[status[i]] - 1 - len(friend[i])
for i in range(K):
    a, b = list(map(int, input().split()))
    if status[a-1] == status[b-1]:
        ans[a-1] -= 1
        ans[b-1] -= 1
print((" ".join(map(str, ans))))


# Optimized solution
import sys
input = sys.stdin.readline
from collections import deque
import copy

N, M, K = list(map(int, input().split()))
friend = [deque() for _ in range(N)]
status = [-1]*N
numList = [0]*N
ans = [0]*N

for _ in range(M):
    a, b = list(map(int, input().split()))
    friend[a-1].append(b-1)
    friend[b-1].append(a-1)
    ans[a-1] -= 1
    ans[b-1] -= 1

def DFS(graph, v, num):
    cnt = 0
    stack = [v]
    status[v] = num
    while stack:
        v = stack[-1]
        if graph[v]:
            w = graph[v].popleft()
            if status[w] == -1:
                status[w] = num
                cnt += 1
                stack.append(w) 
        else:
            stack.pop() 
    numList[num] = cnt

cnt = 0
for i in range(N):
    if status[i] == -1:
        DFS(friend, i, cnt)
        cnt += 1

for i in range(N):
    ans[i] += numList[status[i]]

for i in range(K):
    a, b = list(map(int, input().split()))
    if status[a-1] == status[b-1]:
        ans[a-1] -= 1
        ans[b-1] -= 1

print((" ".join(map(str, ans))))
# Original solution
from collections import deque
import sys
input = sys.stdin.readline

def connected_components(graph):
  seen = set()
  def component(n):
    nodes = set([n])
    while nodes:
      n = nodes.pop()
      seen.add(n)
      nodes |= set(graph[n]) - seen
      yield n
  for n in graph:
    if n not in seen:
      yield component(n)

n,m,k=list(map(int,input().split()))
friend={i:set() for i in range(n)}
for i in range(m):
  a,b=list(map(int,input().split()))
  friend[a-1].add(b-1)
  friend[b-1].add(a-1)
block={i:set() for i in range(n)}
for i in range(k):
  c,d=list(map(int,input().split()))
  block[c-1].add(d-1)
  block[d-1].add(c-1)
checked=set()
belongs=[-1 for i in range(n)]
renketsu=[]
b = 0
g = [list(x) for x in connected_components(friend)]
fnum=[-1 for i in range(n)]
for graph in g:
  s = set(graph)
  for x in graph:
    fnum[x] = len(s - friend[x] - block[x]) - 1
print((' '.join(map(str,fnum))))

# Optimized solution
import sys
input = sys.stdin.readline

def connected_components(graph):
  seen = set()
  def component(n):
    nodes = set([n])
    while nodes:
      n = nodes.pop()
      seen.add(n)
      nodes |= graph[n] - seen
      yield n
  for n in graph:
    if n not in seen:
      yield component(n)

n,m,k=list(map(int,input().split()))
friend={i:set() for i in range(n)}
for i in range(m):
  a,b=list(map(int,input().split()))
  friend[a-1].add(b-1)
  friend[b-1].add(a-1)
block={i:set() for i in range(n)}
for i in range(k):
  c,d=list(map(int,input().split()))
  block[c-1].add(d-1)
  block[d-1].add(c-1)
c = connected_components(friend)
fnum=[-1 for i in range(n)]
for graph in c:
  s = set(graph)
  for x in s:
    fnum[x] = len(s) - len(s & block[x]) -len(friend[x])- 1
print((' '.join(map(str,fnum))))
# Original solution
# coding: utf-8
from sys import setrecursionlimit


def dfs(node: int):
    if checked[node]:
        return

    checked[node] = True
    chain.add(node)
    for n in friends[node]:
        dfs(n)


def solve(*args: str) -> str:
    setrecursionlimit(2 * 10 ** 9)
    n, m, k = list(map(int, args[0].split()))

    global friends
    friends = {i: set() for i in range(n+1)}
    blocked = {i: set() for i in range(n+1)}

    for a, b in map(str.split, args[1:1+m]):
        friends[int(a)].add(int(b))
        friends[int(b)].add(int(a))

    for c, d in map(str.split, args[1+m:1+m+k]):
        blocked[int(c)].add(int(d))
        blocked[int(d)].add(int(c))

    global checked
    checked = [False]*(n+1)

    ret = [0]*(n+1)
    for a in range(1, n+1):
        if checked[a]:
            continue

        global chain
        chain = set()
        dfs(a)
        count = len(chain) - 1
        for i in chain:
            ret[i] += count - len(chain & (friends[i] | blocked[i]))

    return ' '.join(map(str, ret[1:]))


if __name__ == "__main__":
    print((solve(*(open(0).read().splitlines()))))


# Optimized solution
# coding: utf-8


def solve(*args: str) -> str:
    n, m, k = list(map(int, args[0].split()))

    friends = [set() for _ in range(n+1)]
    blocked = [set() for _ in range(n+1)]

    for a, b in map(str.split, args[1:1+m]):
        friends[int(a)].add(int(b))
        friends[int(b)].add(int(a))

    for c, d in map(str.split, args[1+m:1+m+k]):
        blocked[int(c)].add(int(d))
        blocked[int(d)].add(int(c))

    checked = set()

    ret = [0]*(n+1)
    for a in range(1, n+1):
        if a in checked:
            continue

        chain = set()

        stack = list(friends[a])
        while stack:
            b = stack.pop()
            if b in checked:
                continue

            checked.add(b)
            chain.add(b)
            stack.extend(friends[b])

        count = len(chain) - 1
        for i in chain:
            ret[i] += count - len(chain & (friends[i] | blocked[i]))

    return ' '.join(map(str, ret[1:]))


if __name__ == "__main__":
    print((solve(*(open(0).read().splitlines()))))
# Original solution
class UnionFind:
  def __init__(self, size):
    self.parents = [x for x in range(size)]
    self.sizes = [1] * size
  
  def unite(self, a, b):
    if self.find(a) == self.find(b):
      return
    
    if self.size_of(a) > self.size_of(b):
      self.sizes[self.find(a)] += self.size_of(b)
      self.parents[self.find(b)] = self.find(a)
    else:
      self.sizes[self.find(b)] += self.size_of(a)
      self.parents[self.find(a)] = self.find(b)
  
  def is_same(self, a, b):
    return self.find(a) == self.find(b)
  
  def size_of(self, a):
    return self.sizes[self.find(a)]
  
  def find(self, a):
    if a == self.parents[a]:
      return a
    else:
      self.parents[a] = self.find(self.parents[a])
      return self.parents[a]


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

u = UnionFind(N)

# 自分自身・友達・ブロック関係のいずれかの場合はフラグ立つ
relations = [1 << i for i in range(N)]

for _ in range(M):
  a, b = list(map(int, input().split()))
  a, b = a - 1, b - 1
  relations[a] |= 1 << b
  relations[b] |= 1 << a
  u.unite(a, b)
  
for _ in range(K):
  c, d = list(map(int, input().split()))
  c, d = c - 1, d - 1
  
  # 同じ連結成分に含まれないブロック関係は無視してok
  if u.is_same(c, d):
    relations[c] |= 1 << d
    relations[d] |= 1 << c

candidates = []

for i in range(N):
  # candidates.append(u.size_of(i) - bin(relations[i]).count('1'))
  candidates.append(u.size_of(i) - bin(relations[i]).count('1'))
    
print((' '.join(str(x) for x in candidates)))

# Optimized solution
import sys
sys.setrecursionlimit(2 ** 30)
N, M, K = list(map(int, input().split()))

groups = [None] * N
visited = set()

# 連結成分を求める
def dfs(group, i):
  if i in visited:
    return
  
  visited.add(i)
  group.add(i)
  groups[i] = group
  # 他のノード
  for c in graph[i]:
    if not c in visited:
      dfs(group, c)
  

graph = [set() for _ in range(N)]

friends_count = [0] * N
block_count = [0] * N

for _ in range(M):
  a, b = list(map(int, input().split()))
  a, b = a - 1, b - 1
  friends_count[a] += 1
  friends_count[b] += 1
  graph[a].add(b)
  graph[b].add(a)
  
for i in range(N):
  dfs(set(), i)
      
for _ in range(K):
  c, d = list(map(int, input().split()))
  c, d = c - 1, d - 1
  
  # 同じ連結成分に含まれないブロック関係は無視してok
  if d in groups[c]:
    block_count[c] += 1
    block_count[d] += 1

candidates = []

for i in range(N): 
  candidates.append(
    len(groups[i]) - friends_count[i] - block_count[i] - 1
  )
    
print((' '.join(str(x) for x in candidates)))
# Original solution
from collections import deque

class Graph:
    # n is the number of N
    # E is a set of edges where each edge is a two tuple (u, v)
    def __init__(self, n, E):
        self.N = n # number of vertices
        self.V = list(range(0, n)) # V = [0, 1, ..., n-1]
        self.AL = [set() for i in range(n)] # adjacency list
        for e in E:
            self.add_edge(e[0], e[1])

    def add_edge(self, u, v): # u is head, v is tail
        self.AL[u].add(v)
        self.AL[v].add(u)

# 入力
N, M, K = [int(x) for x in input().split()]
Ef = [-1] * M
Eb = [-1] * K

for i in range(M):
    Ef[i] = [int(x) - 1 for x in input().split()]

for i in range(K):
    Eb[i] = [int(x) - 1 for x in input().split()]

Gf = Graph(N, Ef)   # 友達
Gb = Graph(N, Eb)   # ブロック
ans = [0] * N
visited = [False] * N

for root in range(N):
    if visited[root]: continue
    que = deque()
    que.append(root)
    tree_nodes = set()

    while len(que) > 0:
        u = que.pop()
        visited[u] = True
        tree_nodes.add(u)
        
        for v in Gf.AL[u]:
            if visited[v] or v in que:
                continue
            que.append(v)

    for v in tree_nodes:
        ans[v] = max(0, len(tree_nodes) - 1 - len(Gb.AL[v] & tree_nodes)- len(Gf.AL[v]))

print((" ".join([str(f) for f in ans])))


# Optimized solution
# Union-Find木（サイズ付き）
class UnionFind():
    # 初めは全ての頂点が別々の木の根
    def __init__(self, n):  # n要素で初期化
        self.parent = [None] * n # 親
        self.rank = [None] * n   # 木の深さ
        self._size = [1] * n # 要素が属する集合の大きさ（根の要素のみ参照すること）
        for i in range(n):
            self.parent[i] = i
            self.rank[i] = 0

    # 木の根を求める
    def root_of(self, x):
        children = [x]
        while self.parent[x] != x:
            x = self.parent[x]
            children.append(x)

        for ch in children:
            self.parent[ch] = x

        return x

    # xとyの属する集合を併合
    def unite(self, x, y):
        rx = self.root_of(x)
        ry = self.root_of(y)
        if rx == ry:
            return
        if self.rank[rx] < self.rank[ry]: # ランクの小さい木から大きい木の根に辺を張る
            self.parent[rx] = ry  # rxをryの子とする
            self._size[ry] += self._size[rx]
        else:
            self.parent[ry] = rx
            self._size[rx] += self._size[ry]
            if self.rank[rx] == self.rank[ry]:
                self.rank[rx] += 1

    # 同じ集合に属するかどうか
    def is_same(self, x, y):
        return self.root_of(x) == self.root_of(y)

    # 頂点xが属する集合のサイズ
    def size(self, x):
        return self._size[self.root_of(x)]


# 入力
N, M, K = [int(x) for x in input().split()]

Ef = [[int(x) - 1 for x in input().split()] for _ in range(M)]
Eb = [[int(x) - 1 for x in input().split()] for _ in range(K)]

ans = [0] * N
uf = UnionFind(N)
for i in range(M):
    uf.unite(Ef[i][0], Ef[i][1])
    ans[Ef[i][0]] -= 1  # すでに友達なら友達候補ではない
    ans[Ef[i][1]] -= 1

for i in range(K):
    if uf.is_same(Eb[i][0], Eb[i][1]):
        ans[Eb[i][0]] -= 1  # ブロックしているなら友達候補ではない
        ans[Eb[i][1]] -= 1

for i in range(N):
    ans[i] += uf.size(i) - 1

print((" ".join([str(i) for i in ans])))
# Original solution
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 same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
n,m,k = list(map(int,input().split()))
uf = UnionFind(n)
block = {i:[] for i in range(n)}
count = [0 for i in range(n)]
for i in range(m):
    a,b = list(map(int,input().split()))
    uf.union(a-1,b-1)   
    block[min(a-1,b-1)].append(max(a-1,b-1))
for i in range(k):
    c,d = list(map(int,input().split()))
    block[min(c-1,d-1)].append(max(c-1,d-1))
for j in uf.all_group_members():
    for k in uf.all_group_members()[j]:
        for l in uf.all_group_members()[j] :
            if k < l and not max(k,l) in block[min(k,l)]:
                count[k] += 1
                count[l] += 1
print((" ".join(map(str,count))))


# Optimized solution
import sys
sys.setrecursionlimit(100000)
class UnionFind():
    def __init__(self, n):
        self.parents = [-1]*n
        self.count = [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
        self.parents[y] = x
        self.count[x] +=  self.count[y]
n,m,k = list(map(int,input().split()))
uf = UnionFind(n)
block = [[] for i in range(n)]
for i in range(m):
    a,b = list(map(int,input().split()))
    uf.union(a-1,b-1) 
    block[a-1].append(b-1)
    block[b-1].append(a-1)
for i in range(k):
    c,d = list(map(int,input().split()))
    if uf.find(c-1) == uf.find(d-1):
        block[c-1].append(d-1)
        block[d-1].append(c-1)
ans = []
for i in range(n):
    ans.append(uf.count[uf.find(i)]-len(block[i])-1)
print((" ".join(map(str,ans))))
# Original solution
N,M,K=list(map(int,input().split()))
fdic={}
for i in range(1,N+1):
  fdic[i]=set()  
for i in range(M):
  a,b=list(map(int,input().split()))
  fdic[a].add(b)
  fdic[b].add(a)

bdic={}
for i in range(1,N+1):
  bdic[i]=set()
for i in range(K):
  c,d=list(map(int,input().split()))
  bdic[c].add(d)
  bdic[d].add(c)
  
#print(fdic)
#print(bdic)

dic_cluster={}
cluster_num=0
cluster_list=[0]*(N+1)

for i in range(1,N+1):
  if cluster_list[i]>0:
    continue
  else:
    cluster_num+=1
    dic_cluster[cluster_num]=set()
    visited=set()
    queue=[i]
    while(len(queue)>0):
      new_queue=set()
      for q in queue:
        cluster_list[q]=cluster_num
        dic_cluster[cluster_num].add(q)
        visited.add(q)
        nx=fdic[q]
        for n in nx:
          if not n in visited:
            new_queue.add(n)

      queue=new_queue
      #print(new_queue)
      
#print(cluster_list)
#print(dic_cluster)

candlist=[]
for i in range(1,N+1):
  cluster_i=set(dic_cluster[cluster_list[i]])  
  #print(cluster_i.difference(fdic[i]).difference(bdic[i]))  
  candlist.append(str(len(cluster_i.difference(bdic[i]))-len(fdic[i])-1))
  
print((" ".join(candlist)))


# Optimized solution
N,M,K=list(map(int,input().split()))
fdic={}
for i in range(1,N+1):
  fdic[i]=set()  
for i in range(M):
  a,b=list(map(int,input().split()))
  fdic[a].add(b)
  fdic[b].add(a)

blist=[]
for i in range(K):
  c,d=list(map(int,input().split()))
  blist.append((c,d))
  
#print(fdic)
#print(blist)

dic_cluster={}
cluster_num=0
cluster_list=[0]*(N+1)

for i in range(1,N+1):
  if cluster_list[i]>0:
    continue
  else:
    cluster_num+=1
    dic_cluster[cluster_num]=set()
    visited=set()
    queue=[i]
    while(len(queue)>0):
      new_queue=set()
      for q in queue:
        cluster_list[q]=cluster_num
        dic_cluster[cluster_num].add(q)
        visited.add(q)
        nx=fdic[q]
        for n in nx:
          if not n in visited:
            new_queue.add(n)

      queue=new_queue
      #print(new_queue)
      
#print(cluster_list)
#print(dic_cluster)

candlist=[0]*(N+1)
for i in range(1,N+1):
  candlist[i]=len(dic_cluster[cluster_list[i]])-len(fdic[i])-1
for c,d in blist:
  if d in dic_cluster[cluster_list[c]]:
    candlist[c]-=1
    candlist[d]-=1
  
print((" ".join(map(str,candlist[1:]))))
# Original solution
from collections import deque, Counter
N, M, K = list(map(int, input().split()))
F = [[0 for _ in range(N)] for _ in range(N)]
B = [[0 for _ in range(N)] for _ in range(N)]
for _ in range(M):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    F[a][b] = 1
    F[b][a] = 1

for _ in range(K):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    B[a][b] = 1
    B[b][a] = 1

# まだ探索済みでない頂点からdfs
# どの頂点がどの連結成分に属するかを管理
connect_group = {}

for i in range(N):
    if connect_group.get(i) is not None:
        continue
    stack = deque()
    stack.append(i)
    connect_group[i] = i
    p = -1    
    while len(stack):
        j = stack.pop()
        connect_group[j] = i
        for k, v in enumerate(F[j]):
            if v == 1 and connect_group.get(k) is None:
                stack.append(k)
                connect_group[k] = i
                
ans = []
connect_len = Counter(list(connect_group.values()))
for i in range(N):
    g = connect_group[i]
    l = connect_len[g]
    x = 0
    for j in range(N):
        if i != j:
            if g == connect_group[j]:
                if F[i][j] or B[i][j]:
                    x += 1
    ans.append(str(l - x - 1))

print((' '.join(ans)))

# Optimized solution
from collections import deque, Counter
N, M, K = list(map(int, input().split()))
F = [[] for _ in range(N)]
B = [[] for _ in range(N)]

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

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

# まだ探索済みでない頂点からdfs
# どの頂点がどの連結成分に属するかを管理
connect_group = {}

for i in range(N):
    if connect_group.get(i) is not None:
        continue
    stack = deque()
    stack.append(i)
    connect_group[i] = i
    p = -1    
    while len(stack):
        j = stack.pop()
        connect_group[j] = i
        for k in F[j]:
            if connect_group.get(k) is None:
                stack.append(k)
                connect_group[k] = i


ans = []
connect_len = Counter(list(connect_group.values()))
for i in range(N):
    g = connect_group[i]
    l = connect_len[g]
    x = 0
    for j in set(F[i]).union(set(B[i])):
        if g == connect_group[j]:
            x += 1
    ans.append(str(l - x - 1))

print((' '.join(ans)))
# Original solution
from collections import deque
n,m,k=map(int,input().split())
fr=[[]]
for i in range(n-1):
  fr.append([])
for i in range(m):
  a,b=map(int,input().split())
  fr[a-1].append(b)
  fr[b-1].append(a)

belong=[0]*n
anslist=[0]*n
count=0
def bfs(k):
  global count
  if belong[k-1]==0:
    count+=1
    use=deque()
    use.append(k)
    ans=0
    aldic={}
    while use:
      if not bool(use):
        break
      else:
        check=use.popleft()
        if check not in aldic:
          aldic[check]=1
          for x in fr[check-1]:
            use.append(x)
    for x in aldic:
      belong[x-1]=count
      anslist[x-1]=len(aldic)-len(fr[x-1])-1

for i in range(1,n+1):
  bfs(i)
for i in range(k):
  a,b=map(int,input().split())
  if belong[a-1]==belong[b-1]:
    anslist[a-1]-=1
    anslist[b-1]-=1
for i in range(0,len(anslist)):
  if i!=len(anslist)-1:
    print(anslist[i],end=" ")
  else:
    print(anslist[i])


# Optimized solution
from collections import deque
n,m,k=map(int,input().split())
fr=[[]]
for i in range(n-1):
  fr.append([])
for i in range(m):
  a,b=map(int,input().split())
  fr[a-1].append(b)
  fr[b-1].append(a)

belong=[0]*n
anslist=[0]*n
count=0
def bfs(k):
  global count
  if belong[k-1]==0:
    count+=1
    use=deque()
    use.append(k)
    ans=0
    aldic={}
    while use:
      check=use.popleft()
      if check not in aldic:
        aldic[check]=1
        for x in fr[check-1]:
          use.append(x)
    for x in aldic:
      belong[x-1]=count
      anslist[x-1]=len(aldic)-len(fr[x-1])-1

for i in range(1,n+1):
  bfs(i)
for i in range(k):
  a,b=map(int,input().split())
  if belong[a-1]==belong[b-1]:
    anslist[a-1]-=1
    anslist[b-1]-=1
for i in range(0,len(anslist)):
  if i!=len(anslist)-1:
    print(anslist[i],end=" ")
  else:
    print(anslist[i])
# Original solution
from collections import defaultdict
from collections import Counter

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

fn = defaultdict(lambda: 1)
CD = [0]*K

par = list(range(N))

def root(x):
    S = set()
    S.add(x)
    y = x
    while True:
        if par[y] == y:
            for s in S:
                par[s] = y
            return y
        S.add(y)
        y = par[y]

def unite(x,y):
    rx = root(x)
    ry = root(y)
    par[rx] = ry

for _ in range(M):
    A,B = map(int,input().split())
    A -= 1
    B -= 1
    fn[A] += 1
    fn[B] += 1
    unite(A,B)
    
for _ in range(K):
    C,D = map(int,input().split())
    C -= 1
    D -= 1
    CD[_] = (C,D)

par = [root(x) for x in range(N)]
c = Counter(par)

RESULT = [(c[par[x]] - fn[x]) for x in range(N)]

for C,D in CD:
    if par[C] == par[D]:
        RESULT[C] -= 1
        RESULT[D] -= 1

print(*RESULT,sep=" ")


# Optimized solution
from collections import defaultdict
from collections import Counter

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

fn = [1]*N
CD = [0]*K

par = list(range(N))

def root(x):
    S = set()
    S.add(x)
    y = x
    while True:
        if par[y] == y:
            for s in S:
                par[s] = y
            return y
        S.add(y)
        y = par[y]

def unite(x,y):
    rx = root(x)
    ry = root(y)
    par[rx] = ry

for _ in range(M):
    A,B = map(int,input().split())
    A -= 1
    B -= 1
    fn[A] += 1
    fn[B] += 1
    unite(A,B)
    
for _ in range(K):
    C,D = map(int,input().split())
    C -= 1
    D -= 1
    CD[_] = (C,D)

par = [root(x) for x in range(N)]
c = Counter(par)

RESULT = [(c[par[x]] - fn[x]) for x in range(N)]

for C,D in CD:
    if par[C] == par[D]:
        RESULT[C] -= 1
        RESULT[D] -= 1

print(*RESULT,sep=" ")
# Original solution
from collections import defaultdict
from collections import Counter

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

fn = [1]*N
CD = [0]*K

par = list(range(N))

def root(x):
    S = set()
    S.add(x)
    y = x
    while True:
        if par[y] == y:
            for s in S:
                par[s] = y
            return y
        S.add(y)
        y = par[y]

def unite(x,y):
    rx = root(x)
    ry = root(y)
    par[rx] = ry

for _ in range(M):
    A,B = map(int,input().split())
    A -= 1
    B -= 1
    fn[A] += 1
    fn[B] += 1
    unite(A,B)
    
for _ in range(K):
    C,D = map(int,input().split())
    C -= 1
    D -= 1
    CD[_] = (C,D)

par = [root(x) for x in range(N)]
c = Counter(par)

RESULT = [(c[par[x]] - fn[x]) for x in range(N)]

for C,D in CD:
    if par[C] == par[D]:
        RESULT[C] -= 1
        RESULT[D] -= 1

print(*RESULT,sep=" ")


# Optimized solution
# ABC157 - D

from collections import Counter

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

fn = [1]*N
CD = [0]*K

par = list(range(N))

def root(x):
    S = set()
    S.add(x)
    y = x
    while True:
        if par[y] == y:
            for s in S:
                par[s] = y
            return y
        S.add(y)
        y = par[y]

def unite(x,y):
    rx = root(x)
    ry = root(y)
    par[rx] = ry

for _ in range(M):
    A,B = map(int,input().split())
    A -= 1
    B -= 1
    fn[A] += 1
    fn[B] += 1
    unite(A,B)
    
for _ in range(K):
    C,D = map(int,input().split())
    C -= 1
    D -= 1
    CD[_] = (C,D)

par = [root(x) for x in range(N)]
c = Counter(par)

RESULT = [(c[par[x]] - fn[x]) for x in range(N)]

for C,D in CD:
    if par[C] == par[D]:
        RESULT[C] -= 1
        RESULT[D] -= 1

print(*RESULT,sep=" ")