from sys import setrecursionlimit

setrecursionlimit(2 * 10 ** 9)



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

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

CD = [list(map(int, input().split())) for _ in range(K)]



f_G = [[] for _ in range(N)]

for a, b in AB:

  a, b = a-1, b-1

  f_G[a].append(b)

  f_G[b].append(a)



b_G = [[] for _ in range(N)]

for c, d in CD:

  c, d = c-1, d-1

  b_G[c].append(d)

  b_G[d].append(c)



def dfs(v):

  if visited[v]:

    return

  visited[v] = True

  for nv in f_G[v]:

    s.add(nv)

    dfs(nv)  



ans = [0] * N

visited = [False] * N



for i in range(N):

  if not visited[i]:

    s = set()

    dfs(i)

    l = len(s)

    for u in s:

      ans[u] = l - 1

      ans[u] -= len(set(f_G[u]) & s)

      ans[u] -= len(set(b_G[u]) & s)



print((*ans))
import sys

sys.setrecursionlimit(10 ** 9)



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)

FG = [0] * N

BG = [0] * N

for _ in range(M):

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

  a, b = a-1, b-1

  uf.union(a, b)

  FG[a] += 1

  FG[b] += 1



for _ in range(K):

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

  c, d = c-1, d-1

  if uf.same(c, d):

    BG[c] += 1

    BG[d] += 1



ans = []

for i in range(N):

  ans.append(uf.size(i) - FG[i] - BG[i] - 1)

  

print((*ans))
from sys import setrecursionlimit

setrecursionlimit(2 * 10**9)
N, M, K = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(M)]
CD = [list(map(int, input().split())) for _ in range(K)]
f_G = [[] for _ in range(N)]
for a, b in AB:
    a, b = a - 1, b - 1
    f_G[a].append(b)
    f_G[b].append(a)
b_G = [[] for _ in range(N)]
for c, d in CD:
    c, d = c - 1, d - 1
    b_G[c].append(d)
    b_G[d].append(c)


def dfs(v):
    if visited[v]:
        return
    visited[v] = True
    for nv in f_G[v]:
        s.add(nv)
        dfs(nv)


ans = [0] * N
visited = [False] * N
for i in range(N):
    if not visited[i]:
        s = set()
        dfs(i)
        l = len(s)
        for u in s:
            ans[u] = l - 1
            ans[u] -= len(set(f_G[u]) & s)
            ans[u] -= len(set(b_G[u]) & s)
print((*ans))

import sys

sys.setrecursionlimit(10**9)


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)
FG = [0] * N
BG = [0] * N
for _ in range(M):
    a, b = list(map(int, input().split()))
    a, b = a - 1, b - 1
    uf.union(a, b)
    FG[a] += 1
    FG[b] += 1
for _ in range(K):
    c, d = list(map(int, input().split()))
    c, d = c - 1, d - 1
    if uf.same(c, d):
        BG[c] += 1
        BG[d] += 1
ans = []
for i in range(N):
    ans.append(uf.size(i) - FG[i] - BG[i] - 1)
print((*ans))

-from sys import setrecursionlimit +import sys -setrecursionlimit(2 * 10**9) -N, M, K = list(map(int, input().split())) -AB = [list(map(int, input().split())) for _ in range(M)] -CD = [list(map(int, input().split())) for _ in range(K)] -f_G = [[] for _ in range(N)] -for a, b in AB: -    a, b = a - 1, b - 1 -    f_G[a].append(b) -    f_G[b].append(a) -b_G = [[] for _ in range(N)] -for c, d in CD: -    c, d = c - 1, d - 1 -    b_G[c].append(d) -    b_G[d].append(c) +sys.setrecursionlimit(10**9) -def dfs(v): -    if visited[v]: -        return -    visited[v] = True -    for nv in f_G[v]: -        s.add(nv) -        dfs(nv) +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()) -ans = [0] * N -visited = [False] * N +N, M, K = list(map(int, input().split())) +uf = UnionFind(N) +FG = [0] * N +BG = [0] * N +for _ in range(M): +    a, b = list(map(int, input().split())) +    a, b = a - 1, b - 1 +    uf.union(a, b) +    FG[a] += 1 +    FG[b] += 1 +for _ in range(K): +    c, d = list(map(int, input().split())) +    c, d = c - 1, d - 1 +    if uf.same(c, d): +        BG[c] += 1 +        BG[d] += 1 +ans = [] -    if not visited[i]: -        s = set() -        dfs(i) -        l = len(s) -        for u in s: -            ans[u] = l - 1 -            ans[u] -= len(set(f_G[u]) & s) -            ans[u] -= len(set(b_G[u]) & s) +    ans.append(uf.size(i) - FG[i] - BG[i] - 1)