An SNS has N users - User 1, User 2, \cdots, User N.
Between these N users, there are some relationships - M friendships and K blockships.
For each i = 1, 2, \cdots, M, there is a bidirectional friendship between User A_i and User B_i.
For each i = 1, 2, \cdots, K, there is a bidirectional blockship between User C_i and User D_i.
We define User a to be a friend candidate for User b when all of the following four conditions are satisfied:
 - a \neq b.
 - There is not a friendship between User a and User b.
 - There is not a blockship between User a and User b.
 - There exists a sequence c_0, c_1, c_2, \cdots, c_L consisting of integers between 1 and N (inclusive) such that c_0 = a, c_L = b, and there is a friendship between User c_i and c_{i+1} for each i = 0, 1, \cdots, L - 1.
For each user i = 1, 2, ... N, how many friend candidates does it have?

-----Constraints-----
 - All values in input are integers.
 - 2 ≤ N ≤ 10^5
 - 0 \leq M \leq 10^5
 - 0 \leq K \leq 10^5
 - 1 \leq A_i, B_i \leq N
 - A_i \neq B_i
 - 1 \leq C_i, D_i \leq N
 - C_i \neq D_i
 - (A_i, B_i) \neq (A_j, B_j) (i \neq j)
 - (A_i, B_i) \neq (B_j, A_j)
 - (C_i, D_i) \neq (C_j, D_j) (i \neq j)
 - (C_i, D_i) \neq (D_j, C_j)
 - (A_i, B_i) \neq (C_j, D_j)
 - (A_i, B_i) \neq (D_j, C_j)

-----Input-----
Input is given from Standard Input in the following format:
N M K
A_1 B_1
\vdots
A_M B_M
C_1 D_1
\vdots
C_K D_K

-----Output-----
Print the answers in order, with space in between.

-----Sample Input-----
4 4 1
2 1
1 3
3 2
3 4
4 1

-----Sample Output-----
0 1 0 1

There is a friendship between User 2 and 3, and between 3 and 4. Also, there is no friendship or blockship between User 2 and 4. Thus, User 4 is a friend candidate for User 2.
However, neither User 1 or 3 is a friend candidate for User 2, so User 2 has one friend candidate.

Difficulty: interview

Starter code:

Solutions:
import collections
N, M, K = map(int, input().split())
friend = [[] for i in range(N)]
block = [[] for i in range(N)]
graph = [-1] * N
for i in range(M):
  a, b = map(int, input().split())
  friend[a-1].append(b-1)
  friend[b-1].append(a-1)
  
for i in range(K):
  c, d = map(int, input().split())
  block[c-1].append(d-1)
  block[d-1].append(c-1)
  
#print(friend, block)

used = [True] * N
for i in range(N):
  if used[i]:
    q = [i]
    used[i] = False
    graph[i] = i
    while q:
      now = q.pop()
      for j in friend[now]:
        if used[j]:
          graph[j] = graph[now]
          q.append(j)
          used[j] = False
          
          
#print(graph)          
gg = dict(collections.Counter(graph))  
#print(gg)

for i in range(N):
  nn = graph[i]
  size = gg[nn]
  ans = size - 1
  for j in friend[i]:
    if nn == graph[j]:
      ans -= 1
  for j in block[i]:
    if nn == graph[j]:
      ans -= 1
  print(ans, end = " ")




from collections import deque
N, M, K = map(int, input().split())

flst = []
blst = []
glooplst = [i for i in range(N+1)]
colorlst = [0]*(N+1)
countlst = [0]*(N+1)
anslst = [0]*(N+1)
d = deque()

for i in range(N+1):
    flst.append([])
    blst.append([])


for i in range(M):
    a, b = map(int, input().split())
    flst[a].append(b) 
    flst[b].append(a)


for i in range(K):
    a, b = map(int, input().split())
    blst[a].append(b)
    blst[b].append(a)


for i in range(1, N+1):
    if colorlst[i] == 0:
        d.append(i)
        colorlst[i] = 1
        countlst[i] += 1
        while d:
            now = d.popleft()
            for j in flst[now]:
                if colorlst[j] == 0:
                    d.append(j)
                    colorlst[j] = 1
                    glooplst[j] = i
                    countlst[i] += 1

for i in range(1, N+1):
    cnt = countlst[glooplst[i]] - len(flst[i]) -1
    for j in blst[i]:
        if glooplst[i] == glooplst[j]:
            cnt -= 1

    print(cnt, end=' ')

print()


def LI():
    return list(map(int, input().split()))


def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x])
        return par[x]


def unite(x, y):
    x = find(x)
    y = find(y)

    if x == y:
        return False
    else:
        if par[x] > par[y]:
            x, y = y, x
        par[x] += par[y]
        par[y] = x
        return True


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


def size(x):
    return -par[find(x)]


N, M, K = LI()
par = [-1]*N
not_kouho = [[] for _ in range(N)]
for i in range(M):
    a, b = map(int, input().split())
    unite(a - 1, b - 1)
    not_kouho[a-1].append(b-1)
    not_kouho[b-1].append(a-1)

for i in range(K):
    a, b = map(int, input().split())
    if same(a-1, b-1):
        not_kouho[a-1].append(b-1)
        not_kouho[b-1].append(a-1)

for i in range(N):
    print(size(i)-len(not_kouho[i])-1, end=" ")


class UnionFind:
    def __init__(self, N):
        self.N = N

        # the parent of all node is itself
        # self.parent = list(range(N))
        self.parent = [-1] * N

    def root(self, i):
        if self.parent[i] < 0:
            return i

        r = self.root(self.parent[i])
        self.parent[i] = r
        return r

    def unite(self, i, j):
        i = self.root(i)
        j = self.root(j)

        if i == j:
            return

        if i > j:
            i, j = j, i

        self.parent[i] += self.parent[j]
        self.parent[j] = i
        # print(self.parent)

    def same(self, i, j):
        return self.root(i) == self.root(j)

    def size(self, i):
        return -self.parent[self.root(i)]

    def roots(self):
        return [self.root(i) for i in range(self.N)]

    def groupcount(self):
        return len(set(self.roots()))

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

notfriend = [set() for _ in range(N)]
forest = UnionFind(N)

# friend
for i in range(M):
    a, b = map(int, input().split())
    a, b = a - 1, b - 1
    notfriend[a].add(b)
    notfriend[b].add(a)

    forest.unite(a, b)

# block
for i in range(K):
    a, b = map(int, input().split())
    a, b = a - 1, b - 1
    if forest.same(a, b):
        notfriend[a].add(b)
        notfriend[b].add(a)

ans = ' '.join([str(forest.size(i) - 1 - len(notfriend[i])) for i in range(N)])
print(ans)

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 set([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())

n, m, k = list(map(int, input().split()))
#集合で見ていくのが一番速いのでunionfindを扱う
friend_un = UnionFind(n)
#答え用のlist
lst = [0] * n
for _ in range(m):
  a, b = list(map(int, input().split()))
  a -= 1
  b -= 1
  #友達同士で同じ集合を形成していくことで、数の集計が楽になる
  friend_un.union(a, b)
  #友達候補には友達同士は含まないので、答え用のリストには予め1減らしておく
  lst[a] -= 1
  lst[b] -= 1
for _ in range(k):
  a, b = list(map(int, input().split()))
  a -= 1
  b -= 1
  #ブロック同士が同じ集合内にいた場合、これも友達候補には含めないので答え用のリストには1減らしておく
  if friend_un.same(a, b):
    lst[a] -= 1
    lst[b] -= 1
for i in range(n):
  #自分の数も含めているので1減らしておく
  lst[i] += friend_un.size(i) - 1
print((' '.join([str(i) for i in lst])))


class UnionFind():
  def __init__(self,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)]


N,M,K=map(int,input().split())
uf=UnionFind(N+1)
friends={x:set() for x in range(1,N+1)}
blocks={x:set() for x in range(1,N+1)}
ans=[N-1]*(N+1)

for _ in range(M):
  A,B=map(int,input().split())
  friends[A].add(B)
  friends[B].add(A)
  uf.union(A,B)

for _ in range(K):
  C,D=map(int,input().split())
  if uf.find(C)==uf.find(D):
    blocks[C].add(D)
    blocks[D].add(C)

for i in range(1,N+1):
  if uf.size(i)==-1:
    print(0)
    continue
  print(abs(uf.size(i))-len(friends[i])-len(blocks[i])-1,end=' ')

import sys,collections
input = sys.stdin.readline

def main():
    N,M,K = list(map(int,input().split()))
    fr = [[] for i in range(N+1)]
    bl = [[] for i in range(N+1)]

          
    for _ in range(M):
        a,b = list(map(int,input().split()))
        fr[a].append(b)
        fr[b].append(a)
    for _ in range(K):
        c,d = list(map(int,input().split()))
        bl[c].append(d)
        bl[d].append(c)

    fl = [-1 for i in range(N+1)]
    fl[0] = 0
    fl[1] = 1
    nxt = 1
    dic = {}
    s = set(range(1,N+1))
    while nxt != 0:
        q = collections.deque([nxt])
        
        fl[nxt]=nxt
        cnt = 0
        while q:
            now = q.popleft()
            s.discard(now)
            for f in fr[now]:
                if fl[f] == -1:
                    fl[f] = nxt
                    cnt +=1
                    q.append(f)
        dic[nxt] = cnt
        #try:
            #nxt = fl.index(-1)
        #except:
            #nxt = 0
        if len(s) == 0:
            nxt = 0
        else:
            nxt = s.pop()


    mbf = collections.deque()
    for i in range(1,N+1):
        ff = 0
        for j in bl[i]:
            if fl[j] == fl[i]:
                ff -= 1
        
        ff += dic[fl[i]]-len(fr[i])
        mbf.append(ff)
    print((*mbf))

def __starting_point():
    main()

__starting_point()

class UnionFind:
    def __init__(self, n: int) -> None:
        self.forest = [-1] * n

    def union(self, x: int, y: int) -> None:
        x = self.findRoot(x)
        y = self.findRoot(y)
        if x == y:
            return
        if self.forest[x] > self.forest[y]:
            x, y = y, x
        self.forest[x] += self.forest[y]
        self.forest[y] = x
        return

    def findRoot(self, x: int) -> int:
        if self.forest[x] < 0:
            return x
        else:
            self.forest[x] = self.findRoot(self.forest[x])
            return self.forest[x]

    def issame(self, x: int, y: int) -> bool:
        return self.findRoot(x) == self.findRoot(y)

    def size(self, x: int) -> int:
        return -self.forest[self.findRoot(x)]


n, m, k = list(map(int, input().split()))
u = UnionFind(n)
dire = [[] for i in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    dire[a - 1].append(b - 1)
    dire[b - 1].append(a - 1)
    u.union(a - 1, b - 1)
for i in range(k):
    c, d = list(map(int, input().split()))
    if u.issame(c-1,d-1):
        dire[c - 1].append(d - 1)
        dire[d - 1].append(c - 1)

print((*[u.size(i) - len(dire[i]) - 1 for i in range(n)]))


N,M,K=map(int,input().split())
par=[-1]*N
def find(x):
    if par[x] < 0:
        return x
    else:
        tank = []
        while par[x] >= 0:
            tank.append(x)
            x = par[x]
        for elt in tank:
            par[elt] = x
        return x
def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y:
        return False
    else:
      if find(x)>find(y):x,y=y,x
      par[x] += par[y]
      par[y] = x
      return True
frbl=[0]*N
for i in range(M):
  a,b=sorted(map(int,input().split()))
  unite(a-1,b-1)
  frbl[a-1]+=1;frbl[b-1]+=1
block=[0]*N
for i in range(K):
  c,d=sorted(map(int,input().split()))
  if find(c-1)==find(d-1):
    frbl[c-1]+=1;frbl[d-1]+=1
list=[]
for i in range(N):
  list.append(max(-par[find(i)]-frbl[i]-1,0))
print(*list)

f=lambda:map(int,input().split())
n,m,k=f()

# Union_Find
p=[-1]*n
def root(x):
  while p[x]>=0: x=p[x]
  return x
def unite(x,y):
  x,y=root(x),root(y)
  if x==y: return
  if x>y: x,y=y,x
  p[x]+=p[y]
  p[y]=x
def same(x,y):
  return root(x)==root(y)
def size(x):
  return -p[root(x)]

l=[-1]*n
for _ in range(m):
  a,b=f()
  unite(a-1,b-1)
  l[a-1]-=1
  l[b-1]-=1
for i in range(n):
  l[i]+=size(i)
for _ in range(k):
  c,d=f()
  if same(c-1,d-1):
    l[c-1]-=1
    l[d-1]-=1
print(*l)

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

friend = [[] for i in range(n)]
block = [[] for i in range(n)]

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())

uf = UnionFind(n)

for i in range(m):
    a, b = list(map(int, input().split()))
    a-=1
    b-=1
    uf.union(a,b)
    friend[a].append(b)
    friend[b].append(a)

for i in range(k):
    c, d = list(map(int, input().split()))
    c-=1
    d-=1
    block[c].append(d)
    block[d].append(c)

ans=[]

for i in range(n):
    ans1 = uf.size(i)-1
    for j in block[i]:
        if uf.same(i,j):
            ans1-=1
    ans1 -= len(friend[i])
    ans.append(str(ans1))

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


class UnionFind:
    def __init__(self, numV):
        self.pars = list(range(numV))
        self.ranks = [0] * numV
        self.sizes = [1] * numV
    def getRoot(self, x):
        par = self.pars[x]
        if par != x:
            self.pars[x] = par = self.getRoot(par)
        return par
    def merge(self, x, y):
        x, y = self.getRoot(x), self.getRoot(y)
        sx, sy = self.sizes[x], self.sizes[y]
        if x == y: return (0, 0)
        if self.ranks[x] < self.ranks[y]:
            self.pars[x] = y
            self.sizes[y] += sx
        else:
            self.pars[y] = x
            self.sizes[x] += sy
            if self.ranks[x] == self.ranks[y]:
                self.ranks[x] += 1
        return (sx, sy)
    def isSame(self, x, y):
        return self.getRoot(x) == self.getRoot(y)
    def updatePars(self):
        for v in range(len(self.pars)):
            self.getRoot(v)
    def getSize(self, x):
        return self.sizes[self.getRoot(x)]

n, m, k = map(int, input().split())

uf = UnionFind(n)
ex = [[] for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    uf.merge(a,b)
    ex[a].append(b)
    ex[b].append(a)

for i in range(k):
    c, d = map(int, input().split())
    c -= 1
    d -= 1
    if uf.getRoot(c) == uf.getRoot(d):
        ex[c].append(d)
        ex[d].append(c)


ans = []
for i in range(n):
    r = uf.getRoot(i)
    ans.append(uf.sizes[r] - len(list(set(ex[i]))) - 1)
ans = [str(i) for i in ans]
print(' '.join(ans))

import sys
N, M, K = map(int, input().split())
friends = [set() for _ in range(N)]
for _ in range(M):
    a, b = map(int, sys.stdin.readline().split())
    friends[a-1].add(b-1)
    friends[b-1].add(a-1)
blocks = [set() for _ in range(N)]
for _ in range(K):
    c, d = map(int, sys.stdin.readline().split())
    blocks[c-1].add(d-1)
    blocks[d-1].add(c-1)

done = set()
chains = []
todo = []
for s in range(N):
    if s in done:
        continue
    chain = set()
    todo.append(s)
    while todo:
        i = todo.pop()
        for ni in friends[i]:
            if ni in done:
                continue
            done.add(ni)
            chain.add(ni)
            todo.append(ni)
    chains.append(chain)

ans = [0] * N
for chain in chains:
    for i in chain:
        blocks[i].intersection_update(chain)
        ans[i] = len(chain) - len(blocks[i]) - len(friends[i]) - 1
print(" ".join(map(str, ans)))

INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))

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())

def do():
    n,m,k=INTM()
    uf=UnionFind(n)
    fri=[[] for i in range(n)]
    blo=[[] for i in range(n)]
    for i in range(m):
        a,b=INTM()
        a-=1
        b-=1
        fri[a].append(b)
        fri[b].append(a)
        uf.union(a,b)
    for i in range(k):
        c,d=INTM()
        c-=1
        d-=1
        blo[c].append(d)
        blo[d].append(c)

    ans=[]

    for i in range(n):
        blos=0
        for j in blo[i]:
            if uf.same(i,j):
                blos+=1
        
        ans.append(uf.size(i)-1-len(fri[i])-blos)
    
    print(*ans)




def __starting_point():
    do()
__starting_point()

n,m,k = map(int,input().split())
root = [i for i in range(n)]
height = [1 for i in range(n)]
def find(n):
  sn = n
  while n != root[n]:
    n = root[n]
  root[sn] = n
  return n
def union(a,b):
  a = find(a)
  b = find(b)
  if a==b:
    return
  elif height[a]>=height[b]:
    height[a] += height[b]
    height[b] = 0
    root[b] = a
  else:
    height[b] += height[a]
    height[a] = 0
    root[a] = b
l = [set() for _ in range(n)]
for i in range(m):
  a,b = map(lambda x:int(x)-1,input().split())
  union(a,b)
  l[a].add(b)
  l[b].add(a)
for i in range(k):
  a,b = map(lambda x:int(x)-1,input().split())
  if find(a)==find(b):
    l[a].add(b)
    l[b].add(a)
print(*[height[find(i)]-len(l[i])-1 for i in range(n)])

N,M,K=map(int,input().split())
par=[0]*(N+1)
num=[0]*(N+1)
group = [1]*(N+1)

for i in range(1,N+1): par[i]=i

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

def union(x,y):
  rx = root(x)
  ry = root(y)
  if rx==ry: return
  par[max(rx,ry)] = min(rx,ry)
  group[min(rx,ry)] += group[max(rx,ry)]

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

for _ in range(M):
  a,b=map(int,input().split())
  union(a,b)
  num[a]+=1
  num[b]+=1
for _ in range(K):
  c,d=map(int,input().split())
  if same(c,d):
    num[c]+=1
    num[d]+=1

for i in range(1,N+1):
  print(group[root(i)]-num[i]-1,end=" ")

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)
fc=[0]*n
for _ in range(m):
  a,b=list(map(int,input().split()))
  fc[a-1]-=1
  fc[b-1]-=1
  uf.union(a-1,b-1)
for _ in range(k):
  c,d=list(map(int,input().split()))
  if uf.same(c-1,d-1):
    fc[c-1]-=1
    fc[d-1]-=1
for i in range(n):
  fc[i]+=uf.size(i)-1
print((" ".join(list(map(str,fc)))))


N, M, K = list(map(int, input().split()))
friend = [[] for _ in range(N+1)]
block = [[] for _ in range(N+1)]

for i in range(M):
  A,B = list(map(int, input().split()))
  friend[A].append(B)
  friend[B].append(A)

for i in range(K):
  C,D = list(map(int, input().split()))
  block[C].append(D)
  block[D].append(C)
#print(friend)
#print(block)

#import queue
grouping = [False]*(N+1)
#print(grouping)
grouping[0] = True
group = [0]*(N+1)
g_num = 0
g_cnt = []
for i in range(1,N+1):
  cnt = 0
  if grouping[i] == True:
    continue 
  group[i] = g_num
  grouping[i] = True
  #q = queue.Queue()
  #q.put(i)
  stack = [i]
  #while not q.empty():
  while len(stack)>0:
    #print('v:',visited)
    #p = q.get()
    p = stack.pop()
    for f in friend[p]:
      #print(p,f)
      if grouping[f]==False:
        #q.put(f)
        stack.append(f)
        group[f]=g_num
        grouping[f] =True
        cnt += 1
  g_num += 1
  g_cnt.append(cnt)
  #print('g:',grouping)
ans = []
for i in range(1,N+1):
  c = g_cnt[group[i]]-len(friend[i])
  for b in block[i]:
    if group[b]==group[i]:
      c -= 1
  ans.append(c)
print((*ans))


N,M,K=map(int,input().split())
par=[0]*(N+1)
num=[0]*(N+1)
group = [1]*(N+1)

for i in range(1,N+1): par[i]=i

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

def union(x,y):
  rx = root(x)
  ry = root(y)
  if rx==ry: return
  par[max(rx,ry)] = min(rx,ry)
  group[min(rx,ry)] += group[max(rx,ry)]

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

for _ in range(M):
  a,b=map(int,input().split())
  union(a,b)
  num[a]+=1
  num[b]+=1
for _ in range(K):
  c,d=map(int,input().split())
  if same(c,d):
    num[c]+=1
    num[d]+=1

for i in range(1,N+1):
  print(group[root(i)]-num[i]-1,end=" ")

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=map(int,input().split())
uf=UnionFind(n)
edge=[[] for _ in range(n)]
brock=[[] for _ in range(n)]
ans=[]
for _ in range(m):
    a,b=map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
    uf.union(a-1,b-1)
for _ in range(k):
    c,d=map(int,input().split())
    brock[c-1].append(d-1)
    brock[d-1].append(c-1)
for i in range(n):
    ans.append(uf.size(i)-len(edge[i])-sum([uf.same(i,j) for j in brock[i]])-1)
print(*ans)

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):	#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 = map(int,input().split())
suggest = UnionFind(n)
follow = [0]*n
block = [0]*n
for i in range(n):
    follow[i] = list()
    block[i]  = list()
for _ in range(m):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    suggest.union(a,b)
    follow[a].append(b)
    follow[b].append(a)

for _ in range(k):
    c,d = map(int,input().split())
    c -= 1
    d -= 1
    block[c].append(d)
    block[d].append(c)
ans = ""
suggestfriend = [0]*n
ans = ""
for i in range(n):
    blockperson = 0
    union = suggest.size(i)
    for j in range(len(block[i])):
        if(suggest.same(i,block[i][j])):
            blockperson += 1
    ans += str(union - blockperson -len(follow[i]) - 1) + " "
print(ans)

class Union_Find:
  def __init__(self,n=0):
    self.vertices=n
    self.mother=[-1 for i in range(self.vertices)]
    self.size_temp=[1 for i in range(self.vertices)]
  
  def root(self,x):
    normalize_v=[]
    while x!=-1:
      normalize_v.append(x)
      y=x
      x=self.mother[x]
    for i in normalize_v[:-1]:
      self.mother[i]=y
    return y
  
  def union(self,x,y):
    root_x=self.root(x)
    root_y=self.root(y)
    if root_x!=root_y:
      self.mother[root_x]=root_y
      self.size_temp[root_y]+=self.size_temp[root_x]
  
  def find(self,x,y):
    if self.root(x)==self.root(y):
      return True
    else:
      return False
  
  def size(self,x):
    return self.size_temp[self.root(x)]



n,m,k=list(map(int,input().split()))
uf=Union_Find(n)
friend=[0 for i in range(n)]
block=[[] for i in range(n)]

for i in range(m):
  a,b=[int(x)-1 for x in input().split()]
  friend[a]+=1
  friend[b]+=1
  uf.union(a,b)

for i in range(k):
  a,b=[int(x)-1 for x in input().split()]
  block[a].append(b)
  block[b].append(a)

r=""
for i in range(n):
  size=uf.size(i)
  size-=friend[i]
  for j in block[i]:
    if uf.find(i,j):
      size-=1
  r+=str(size-1)+" "
print((r[:-1]))


n, m, k = map(int, input().split())
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.par = [-1 for i in range(self.n)]
    def find(self, x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
    def unite(self, x, y):
        p = self.find(x)
        q = self.find(y)
        if p == q:
            return None
        if p > q:
            p, q = q, p
        self.par[p] += self.par[q]
        self.par[q] = p
    def same(self, x, y):
        return self.find(x) == self.find(y)
    def size(self, x):
        return -self.par[self.find(x)]
UF = UnionFind(n)
f_or_b = [0] * n
for i in range(m):
    a, b = map(int, input().split())
    UF.unite(a - 1, b - 1)
    f_or_b[a - 1] += 1
    f_or_b[b - 1] += 1
for i in range(k):
    c, d = map(int, input().split())
    if UF.same(c - 1, d - 1):
        f_or_b[c - 1] += 1
        f_or_b[d - 1] += 1
for i in range(n):
    print(UF.size(i) - f_or_b[i] - 1, end=" ")


"""/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Union-Find！Union-Find！Union-Find！Union-Findぅぅうううわぁああああああああああああああああああああああん！！！
あぁああああ…ああ…あっあっー！あぁああああああ！！！Union-FindUnion-FindUnion-Findぅううぁわぁああああ！！！
あぁクンカクンカ！クンカクンカ！スーハースーハー！スーハースーハー！いい匂いだなぁ…くんくん
んはぁっ！Union-Findたんの桃色ブロンドの髪をクンカクンカしたいお！クンカクンカ！あぁあ！！
間違えた！モフモフしたいお！モフモフ！モフモフ！髪髪モフモフ！カリカリモフモフ…きゅんきゅんきゅい！！
小説12巻のUnion-Findたんかわいかったよぅ！！あぁぁああ…あああ…あっあぁああああ！！ふぁぁあああんんっ！！
アニメ2期放送されて良かったねUnion-Findたん！あぁあああああ！かわいい！Union-Findたん！かわいい！あっああぁああ！
コミック2巻も発売されて嬉し…いやぁああああああ！！！にゃああああああああん！！ぎゃああああああああ！！
ぐあああああああああああ！！！コミックなんて現実じゃない！！！！あ…小説もアニメもよく考えたら…
U n i o n - F i n d ち ゃ ん は 現 実 じ ゃ な い？にゃあああああああああああああん！！うぁああああああああああ！！
そんなぁああああああ！！いやぁぁぁあああああああああ！！はぁああああああん！！う　し　た　ぷ　に　き　あ　王　国　笑ぁああああ！！
この！ちきしょー！やめてやる！！現実なんかやめ…て…え！？見…てる？表紙絵のUnion-Findちゃんが僕を見てる？
表紙絵のUnion-Findちゃんが僕を見てるぞ！Union-Findちゃんが僕を見てるぞ！挿絵のUnion-Findちゃんが僕を見てるぞ！！
アニメのUnion-Findちゃんが僕に話しかけてるぞ！！！よかった…世の中まだまだ捨てたモンじゃないんだねっ！
いやっほぉおおおおおおお！！！僕にはUnion-Findちゃんがいる！！やったよdefault dict！！ひとりでできるもん！！！
あ、コミックのUnion-Findちゃああああああああああああああん！！いやぁあああああああああああああああ！！！！
あっあんああっああんあset様ぁあ！！さ、最小全域木ー！！Dijkstraぁああああああ！！！セグ木ぃいいい！！
ううっうぅうう！！俺の想いよUnion-Findへ届け！！う　し　た　ぷ　に　き　あ　王　国　笑のUnion-Findへ届け！
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////"""
class UnionFind():
    def __init__(self, n):
        self.parents = list(range(n))
        self.size = [1] * n
    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 union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.size[x] < self.size[y]:
            self.size[y] += self.size[x]
            self.parents[x] = y
        else:
            self.size[x] += self.size[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)
friends=[0]*n
for i in range(m):
    a,b=list(map(int,input().split()))
    uf.union(a-1,b-1)
    friends[a-1]+=1
    friends[b-1]+=1
block=[[] for _ in range(n)]
for i in range(k):
    c,d=list(map(int,input().split()))
    block[c-1].append(d)
    block[d-1].append(c)
ans=[0]*n
cnt=[0]*n
for i in range(n):
    cnt[i]=uf.find(i)
for i in range(n):
    num1=uf.size[uf.find(i)]-friends[i]-1
    num2=cnt[i]
    for j in range(len(block[i])):
        if num2==cnt[block[i][j]-1]:
            num1-=1
    ans[i]=num1
print((*ans))


from sys import stdin

def getval():
    n,m,k = map(int,stdin.readline().split())
    a = [list(map(int,stdin.readline().split())) for i in range(m)]
    c = [list(map(int,stdin.readline().split())) for i in range(k)]
    return n,m,k,a,c 

def main(n,m,k,a,c):
    #Compute all members' friends
    friends = [[] for i in range(n)]
    for i in a:
        friends[i[0]-1].append(i[1]-1)
        friends[i[1]-1].append(i[0]-1)
    
    #Group all members in the isolated "friend groups"
    frgroups = []
    visited = [False for i in range(n)]
    for i in range(n):
        if visited[i]:
            continue
        q = [i]
        temp = [i]
        visited[i] = True
        while q:
            idx = q.pop(0)
            adj = friends[idx]
            for j in adj:
                if visited[j]:
                    continue
                visited[j] = True
                q.append(j)
                temp.append(j)
        frgroups.append(temp)    

    #Number all members with their friend groups respectively
    groups = [-1 for i in range(n)]
    for i in range(len(frgroups)):
        for j in frgroups[i]:
            groups[j] = i 
            
    #For each member, refer to the friend groups of blocked peope
    #Compute ans accordingly
    ans = [len(frgroups[groups[i]])-1-len(friends[i]) for i in range(n)]
    for i in c:
        if groups[i[0]-1]==groups[i[1]-1]:
            ans[i[0]-1] -= 1
            ans[i[1]-1] -= 1
    s = str(ans[0])
    for i in range(1,n):
        s += " " + str(ans[i])
    print(s)
    

def __starting_point():
    n,m,k,a,c = getval()
    main(n,m,k,a,c)
__starting_point()

# UnionFind: https://note.nkmk.me/python-union-find/
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.root = [-1] * (n + 1)
        
    def find(self, x):
        if self.root[x] < 0:
            return x
        else:
            self.root[x] = self.find(self.root[x])
            return self.root[x]
    
    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return False
        if self.root[x] > self.root[y]:
            x, y = y, x
        self.root[x] += self.root[y]
        self.root[y] = x
        
    def is_same(self, x, y):
        return self.find(x) == self.find(y)
    
    def size(self, x):
        return -self.root[self.find(x)]
    
n, m, k = map(int, input().split())
friends = UnionFind(n)
f_or_b = [1] * (n + 1)
for i in range(m):
    a, b = map(int, input().split())
    friends.unite(a, b)
    f_or_b[a] += 1
    f_or_b[b] += 1
for i in range(k):
    c, d = map(int, input().split())
    if friends.is_same(c, d):
        f_or_b[c] += 1
        f_or_b[d] += 1
print(*[friends.size(i) - f_or_b[i] for i in range(1, n + 1)])

class UnionFind():
    """
    Union Find木クラス
    Attributes
    --------------------
    n : int
        要素数
    root : list
        木の要素数
        0未満であればそのノードが根であり、添字の値が要素数
    rank : list
        木の深さ
    """

    def __init__(self, n):
        """
        Parameters
        ---------------------
        n : int
            要素数
        """
        self.n = n
        self.root = [-1]*(n+1)
        self.rank = [0]*(n+1)

    def find_root(self, x):
        """
        ノードxの根を見つける
        Parameters
        ---------------------
        x : int
            見つけるノード
        Returns
        ---------------------
        root : int
            根のノード
        """
        if(self.root[x] < 0):
            return x
        else:
            self.root[x] = self.find_root(self.root[x])
            return self.root[x]

    def unite(self, x, y):
        """
        木の併合
        Parameters
        ---------------------
        x : int
            併合したノード
        y : int
            併合したノード
        """
        # 入力ノードのrootノードを見つける
        x = self.find_root(x)
        y = self.find_root(y)
        # すでに同じ木に属していた場合
        if(x == y):
            return
        # 違う木に属していた場合rankを見てくっつける方を決める
        elif(self.rank[x] > self.rank[y]):
            self.root[x] += self.root[y]
            self.root[y] = x
        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            # rankが同じ（深さに差がない場合）は1増やす
            if(self.rank[x] == self.rank[y]):
                self.rank[y] += 1

    def is_samegroup(self, x, y):
        """
        同じグループに属するか判定
        Parameters
        ---------------------
        x : int
            判定したノード
        y : int
            判定したノード
        Returns
        ---------------------
        ans : bool
            同じグループに属しているか
        """
        return self.find_root(x) == self.find_root(y)

    def count(self, x):
        """
        木のサイズを計算
        Parameters
        ---------------------
        x : int
            計算したい木のノード
        Returns
        ---------------------
        cnt : int
            木のサイズ
        """
        return -self.root[self.find_root(x)]


n, m, k = list(map(int, input().split()))
uf = UnionFind(n)
friend = [0] * n

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

for _ in range(k):
    c, d = list(map(int, input().split()))
    c, d = c-1, d-1
    if uf.is_samegroup(c, d):
        friend[c] += 1
        friend[d] += 1

ans = [0] * n
for i in range(n):
    ans[i] = uf.count(i) - friend[i] - 1

print((*ans))


from collections import defaultdict

class UnionFind():
    def __init__(self, n=0):
        self.d = [-1]*n
    
    def find(self, x):
        if self.d[x] < 0: return x
        self.d[x] = self.find(self.d[x])
        return self.d[x]

    def unite(self, x, y):
        x,y=self.find(x),self.find(y)
        if x==y:return False
        if self.d[x] > self.d[y]: x,y=y,x
        self.d[x] += self.d[y]
        self.d[y] = x
        return True

    def same(self, x,y): return self.find(x)==self.find(y)
    def size(self,x): return -self.d[self.find(x)]
    
N,M,K=map(int,input().split())
uf=UnionFind(N+1)
n_friends=defaultdict(int)
for i in range(M):
  a,b=map(int,input().split())
  uf.unite(a,b)
  n_friends[a] += 1
  n_friends[b] += 1
  
ans = [uf.size(i)-n_friends[i]-1 for i in range(N+1)]

for i in range(K):
  c,d=map(int,input().split())
  if uf.same(c,d):
    ans[c] -= 1
    ans[d] -= 1
  
print(*ans[1:])

class UnionFind:
  def __init__(self, n):
    self.n = n
    self.g = [i for i in range(n)]
    self.nmembers = [1 for i in range(n)]
  def __len__(self):
    return self.n
  def __str__(self):
    return "group:{}\nnmembers:{}".format(self.g,self.nmembers)
  def __getitem__(self,x):
    return self.whichgroup(x)
  def merge(self, x, y):
    gx = self.whichgroup(x)
    gy = self.whichgroup(y)
    if gx != gy:
      nx = self.nmembers[gx]
      ny = self.nmembers[gy]
      ming = min(gx, gy)
      maxg = gx + gy - ming
      self.g[maxg] = ming
      self.nmembers[maxg] = 0
      self.nmembers[ming] = nx + ny
    
  def whichgroup(self, x):
    if x != self.g[x]:
      self.g[x] = self.whichgroup(self.g[x])
      self.nmembers[x] = 0
      return self.g[x]
    else:
      return x

N, M, K = list(map(int, input().split()))
UF = UnionFind(N)
F = [0 for i in range(N)]
B = [0 for i in range(N)]
#print(UF)
for i in range(M):
  x, y = list(map(int, input().split()))
  x, y = x-1, y-1
  #print("x:{}, y:{}".format(x, y))
  UF.merge(x, y)
  F[x] += 1
  F[y] += 1
for i in range(K):
  x, y = list(map(int, input().split()))
  x, y = x-1, y-1
  
  gx = UF.whichgroup(x)
  gy = UF.whichgroup(y)
  if gx == gy:
    B[x] += 1
    B[y] += 1
#print(UF)
ans = []
for i in range(N):
  ans.append(UF.nmembers[UF[i]]-B[i]-F[i]-1)
print((*ans))


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

par=[-1]*N
num=[0]*N

def find(x):
  if par[x]<0:
    return x
  else:
    par[x]=find(par[x])
    return par[x]

def union(x,y):
  p,q=find(x),find(y)
  if p==q:
    return
  if p>q:
    p,q=q,p
  par[p]+=par[q]
  par[q]=p   

def size(x):
  return -par[find(x)]

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

for _ in range(M):
  a,b=map(int,input().split())
  a-=1
  b-=1
  union(a,b)
  num[a]+=1
  num[b]+=1

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

for i in range(N):
  print(size(i)-1-num[i],end=" ")

#これを求めるには

#（頂点iの連結サイズ）　ー　（頂点iと頂点jが同じ連結成分に含まれて人iと人jが友達関係もしくはブロック関係にあるjの数）ー　１

#を計算すれば良い


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

    def root(self,x):
        if self.parents[x] < 0:
            return x
        else:
            return self.root(self.parents[x])
    
    def unite(self,x,y):
        x,y = self.root(x), self.root(y)
        if x == y:
            return 
        else:
            if x > y:
                x,y = y,x
            self.parents[x] += self.parents[y]
            self.parents[y] = x
            return


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)]

u = UnionFind(N)
f = [set() for _ in range(N)]
#要素数がN個の集合の配列　f = [{},{},{},...,{}]

l = [set() for _ in range(N)]
#上記と同様

for a,b in AB:
    a,b = a-1,b-1
    #配列の最初（a = 0,b = 0）から開始するため

    f[a].add(b)
    #f = [...,{b},{},...,{}]
    #配列のa番目の集合の要素にbを加える

    f[b].add(a)
    #f = [.....,{a},{}..,{}]
    #配列のb番目の集合の要素にaを加える

    u.unite(a,b)


for c,d in CD:
    c,d = c-1,d-1
    l[c].add(d)
    l[d].add(c)

ans = [0] * N
#ブロック関係は同じ連結成分かどうかで引くか変わってくる
#同じ連結成分にあるならば、全体の連結成分のサイズから引く
for i in range(N):
    r = u.root(i)
    bl = 0
    #「bl」は引くべきブロック関係の数
    for j in l[i]:
        if u.root(j) == r:
            bl += 1
    
    ans[i] = -u.parents[r] - len(f[i]) - bl -1
print((' '.join(list(map(str,ans)))))



class UnionFind():
    def __init__(self, n):
        self.parents = [-1] * n
    
    def root(self, x):
        if self.parents[x] < 0:
            return x
        else:
            return self.root(self.parents[x])
    
    def unite(self, x, y):
        x, y = self.root(x), self.root(y)
        if x == y:
            return
        else:
            if x > y:
                x, y = y, x
            self.parents[x] += self.parents[y]
            self.parents[y] = x
            return

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

u = UnionFind(n)
f = [set() for _ in range(n)]
l = [set() for _ in range(n)]
for a, b in ab:
    a, b = a-1, b-1
    f[a].add(b)
    f[b].add(a)
    u.unite(a, b)
for c, d in cd:
    c, d = c-1, d-1
    l[c].add(d)
    l[d].add(c)
ans = [0] * n
for i in range(n):
    r = u.root(i)
    bl = 0
    for j in l[i]:
        if u.root(j) == r:
            bl += 1
    ans[i] = -u.parents[r] - len(f[i]) - bl - 1
print(' '.join(list(map(str, ans))))

class UnionFind:
    def __init__(self, n=0):
        self.d = [-1]*n
    def find(self, x):
        if self.d[x] < 0:
            return x
        else:
            self.d[x] = self.find(self.d[x])
            return self.d[x]
    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return False
        if self.d[x] > self.d[y]:
            x, y = y, x
        self.d[x] += self.d[y]
        self.d[y] = x
        return True
    def same(self, x, y):
        return self.find(x) == self.find(y)
    def size(self, x):
        return -self.d[self.find(x)]

n, m, k = map(int, input().split())

deg = [0]*100005
uf = UnionFind(n)
for _ in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    deg[a] += 1
    deg[b] += 1
    uf.unite(a, b)
for _ in range(k):
    c, d = map(int, input().split())
    c -= 1
    d -= 1
    if uf.same(c, d):
        deg[c] += 1
        deg[d] += 1
for i in range(n):
    print(uf.size(i) - 1 - deg[i], end="")
    if i == n-1:
        print()
    else:
        print(" ", end="")


def N():
    return int(input())
def L():
    return list(map(int,input().split()))
def NL(n):
    return [list(map(int,input().split())) for i in range(n)]
mod = pow(10,9)+7

#import numpy as np
import sys
import math
import collections

sys.setrecursionlimit(1000000)

class UnionFind():
    par = []
    def __init__(self,n):
        for i in range(n):
            self.par.append(i)

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

    def same(self,x,y):
        if self.root(x) == self.root(y):
            return True
        else:
            return False

    def unite(self,x,y):
        x = self.root(x)
        y = self.root(y)
        if x==y:
            return
        self.par[y] = x
    
    def comp(self):#rootまでの距離圧縮
        for i in range(len(self.par)):
            self.root(i)
n,m,k = L()
uf = UnionFind(n)
f = [0]*n
for i in range(m):
    a,b = L()
    uf.unite(a-1,b-1)
    f[a-1] += 1
    f[b-1] += 1
uf.comp()

for i in range(k):
    a,b = L()
    if uf.par[a-1] == uf.par[b-1]:
        f[a-1] += 1
        f[b-1] += 1

count = collections.Counter(uf.par)
#print(uf.par)
#print(count)
#print(f)
for i in range(n):
    print(count[uf.par[i]]-f[i]-1,"",end="")
print()

class UnionFind:
    def __init__(self, n):
        self.n = n
        self.parent = [i for i in range(n)]
        self.rank = [1]*n
        self.size = [1]*n
    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            self.parent[x] = self.find(self.parent[x])
            return self.parent[x]
    def unite(self, x, y):
        x = self.find(x); y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                self.parent[x] = y
                self.size[y] += self.size[x]
            else:
                self.parent[y] = x
                self.size[x] += self.size[y]
                if self.rank[x] == self.rank[y]:
                    self.rank[x] += 1
    def is_same(self, x, y):
        return self.find(x) == self.find(y)
    def group_size(self, x):
        return self.size[self.find(x)]
n, m, k = map(int, input().split())
a = [0]*m; b = [0]*m; c = [0]*k; d = [0]*k; x = [0]*n
direct = [[] for _ in range(n)]; uf = UnionFind(n)
for i in range(m):
    a[i], b[i] = map(int, input().split())
    a[i] -= 1; b[i] -= 1
    direct[a[i]].append(b[i]); direct[b[i]].append(a[i])
    uf.unite(a[i], b[i])
for i in range(k):
    c[i], d[i] = map(int, input().split())
    c[i] -= 1; d[i] -= 1
    if uf.is_same(c[i], d[i]):
        direct[c[i]].append(d[i]); direct[d[i]].append(c[i])
for i in range(n): x[i] = uf.group_size(i)-len(direct[i])-1
print(*x)

n,m,k = map(int,input().split())
par = [-1]*(n+1)
def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x]) #経路圧縮
        return par[x]
def same(x,y):
    return find(x) == find(y)
def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y:
        return 0
    else:
        if par[x] > par[y]:
            x,y = y,x
        par[x] += par[y]
        par[y] = x
def size(x):
    return -par[find(x)]
g = [[] for _ in range(n+1)]
b = [[] for _ in range(n+1)]
for _ in range(m):
    s,t = map(int,input().split())
    unite(s,t)
    g[s].append(t)
    g[t].append(s)
for _ in range(k):
    s,t = map(int,input().split())
    b[s].append(t)
    b[t].append(s)
for i in range(1,n+1):
    ans = size(i)-1-len(g[i])
    for e in b[i]:
        if same(i,e):
            ans -= 1
    print(ans,end=" ")

import numpy as np
from scipy.sparse.csgraph import connected_components
from scipy.sparse import csr_matrix

import sys
sys.setrecursionlimit(10**9)
n,m,k=[int(i) for i in input().split()]
frends_num=[0 for i in range(n)]
def make_frends(m,n):
    data=[1 for i in range(m)]

    row=[]
    col=[]
    for k in range(m):
        i,j=[int(l) for l in input().split()]
        new_i=min(i,j)-1
        new_j=max(i,j)-1
        row.append(new_i)
        col.append(new_j)
        frends_num[new_i]+=1
        frends_num[new_j]+=1
    frend_sparce_matrix=csr_matrix((data, (row, col)),shape=(n,n))
    return frend_sparce_matrix


frends=make_frends(m,n)
l,labels=connected_components(frends)
labels
labels=list(labels)

class Group:
    def __init__(self,labels):
        self.labels=labels
        self.group_num=[0 for i in range(l)]
        for i in labels:
            self.group_num[i]+=1
    def get_group_num(self,i):
        return self.group_num[self.labels[i]]

group=Group(labels)


def get_frend_num(i):
    return frends_num[i]


def make_block(k,n):
    block_num=[0 for i in range(n)]
    for p in range(k):
        i,j =[int(l)-1 for l in input().split()]
        new_i=min(i,j)
        new_j=max(i,j)
        if labels[new_i]==labels[new_j]:
            block_num[i]+=1
            block_num[j]+=1
    return block_num

block=make_block(k,n)

def get_block_num(i):
    return block[i]

ans=[]
for i in range(n):
    ans.append(str(group.get_group_num(i)-1-get_frend_num(i)-get_block_num(i)))
print((" ".join(ans)))


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

f_adj_list = [[] for i in range(n)]
b_adj_list = [[] for i in range(n)]

for i in range(m):
  _, __ = list(map(int, input().split()))
  _ -= 1
  __ -= 1
  f_adj_list[_].append(__)
  f_adj_list[__].append(_)
  
for j in range(k):
  _, __ = list(map(int, input().split()))
  _ -= 1
  __ -= 1
  b_adj_list[_].append(__)
  b_adj_list[__].append(_)
  
  
group_id = [None for i in range(n)]
for i in range(n):
  if group_id[i] is not None: continue
  # i から DFS
  newly_visited = [i]
  group_id[i] = i
  while len(newly_visited) > 0:
    now = newly_visited.pop()
    for j in f_adj_list[now]:
      if group_id[j] is not None: continue
      newly_visited.append(j)
      group_id[j] = i

# group_id
# print(group_id)

# 連結成分のサイズ
from collections import Counter
cnt = Counter(group_id)
# cnt[5] = 7

ans_list = []
for i in range(n):
  ans = cnt[group_id[i]]
  ans -= 1 # 自分自身
  ans -= len(f_adj_list[i]) # 直接の友達
  for j in b_adj_list[i]:
    if group_id[i] == group_id[j]:
      ans -= 1
  ans_list.append(ans)

print((" ".join(map(str, ans_list))))


class UnionFind:
    def __init__(self, n: int) -> None:
        self.forest = [-1] * n

    def union(self, x: int, y: int) -> None:
        x = self.findRoot(x)
        y = self.findRoot(y)
        if x == y:
            return
        if self.forest[x] > self.forest[y]:
            x,y = y,x
        self.forest[x] += self.forest[y]
        self.forest[y] = x
        return

    def findRoot(self, x: int) -> int:
        if self.forest[x] < 0:
            return x
        else:
            self.forest[x] = self.findRoot(self.forest[x])
            return self.forest[x]

    def issame(self, x: int, y: int) -> bool:
        return self.findRoot(x) == self.findRoot(y)
    
    def size(self,x: int) -> int:
        return -self.forest[self.findRoot(x)]

n,m,k = map(int,input().split())
l = [[] for _ in range(n)]
u = UnionFind(n)
for _ in range(m):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    u.union(a,b)
    l[a].append(b)
    l[b].append(a)

for _ in range(k):
    c,d = map(int,input().split())
    c -= 1
    d -= 1
    if u.issame(c,d):
        l[c].append(d)
        l[d].append(c)

for i in range(n):
    q = u.size(i)
    w = len(l[i])
    print(q-w-1, end=" ")



from collections import defaultdict
from sys import setrecursionlimit

setrecursionlimit(10**6)

N, M, K = map(int, input().split())
F = [list(map(int, input().split())) for _ in range(M)]
B = [list(map(int, input().split())) for _ in range(K)]

class UFTree():
    def __init__(self, n):
        self.length = n+1
        self.roots = list(range(self.length))

    def union(self, a, b):
        r = self.find(a)
        s = self.find(b)
        self.roots[s] = r

    def find(self, a):
        r = self.roots[a]
        if r == a:
            return a
        r = self.find(r)
        self.roots[a] = r
        return r

    def findall(self):
        for i in range(self.length):
            self.find(i)

    def setli(self):
        self.findall()
        d = defaultdict(set)
        for i, r in enumerate(self.roots):
            if i: d[r].add(i)
        return list(d.values())

    def sameroot(self, a, b):
        r = self.find(a)
        s = self.find(b)
        return r == s

t = UFTree(N)
for a, b in F:
    t.union(a, b)

s = [0]*(N+1)
for a, b in F:
    s[a] -= 1
    s[b] -= 1
for c, d in B:
    if t.sameroot(c, d):
        s[c] -= 1
        s[d] -= 1

for u in t.setli():
    l = len(u)
    for i in u: s[i] += l-1

print(*s[1:])

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


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.par = [i for i in range(n)]
        self.size = [1 for i in range(n)]

    def find(self, x):
        if self.par[x] != x:
            self.par[x] = self.find(self.par[x])
        return self.par[x]

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

        if x == y:
            return
        if self.size[x] > self.size[y]:
            x, y = y, x
        self.par[x] = y
        self.size[y] += self.size[x]


uf = UnionFind(N)
fri = []
rst = [0]*N

for m in range(M):
    A, B = list(map(int, input().split()))
    A -= 1
    B -= 1
    fri.append((A, B))
    uf.unite(A, B)

for i in range(N):
    ind = uf.find(i)
    rst[i] = uf.size[ind]-1

for f in fri:
    A, B = f
    if uf.par[A] == uf.par[B]:
        rst[A] -= 1
        rst[B] -= 1

for k in range(K):
    C, D = list(map(int, input().split()))
    C -= 1
    D -= 1
    if uf.par[C] == uf.par[D]:
        rst[C] -= 1
        rst[D] -= 1

print((" ".join(map(str, rst))))


import sys
# 再帰回数上弦を100000回に設定
sys.setrecursionlimit(100000)
# スタックサイズを無制限に設定
# resource.setrlimit(resource.RLIMIT_STACK, (-1, -1))

class UnionFind:
    """
    子ノードには自分の親ノードIDを記録。親ノードにはグループサイズの負値を記録。
    """

    def __init__(self, n):
        self.node = [-1] * n
    
    def unite(self, x, y):
        """
        xとyが属するグループを統合
        """
        # xとyの親ノードインデックスを取得
        _x, _y = self.find(x), self.find(y)
        # 一致していれば同じグループに属しているので処理終了。
        # Falseはなぞ。
        if _x == _y:
            return False
        # サイズが小さいグループを大きいグループに結合するので、
        # _y側の絶対値がかならず小さくなるように前処理。(_yを_xのグループへ統合)
        # 大きい方を小さい方へ結合してしまうとノードが深くなってしまうので、
        # 計算量を削減するためのテクニック。
        if abs(self.node[_x]) < abs(self.node[_y]):
             self.node[_x], self.node[_y] = self.node[_y], self.node[_x]
        # グループサイズ更新
        self.node[_x] += self.node[_y]
        # _yの親ノードを_xに更新
        self.node[_y] = _x
        return True

    def find(self, x):
        """
        xが属するグループの親ノードインデックスを検索。
        """
        _val = self.node[x]
        # 負なら親ノードとみなして、そのインデックスを返す。
        if _val < 0: 
            return x
        # グループの親ノードを再帰的に検索。
        # さらに、グループの親ノードIDを子ノードに記録しておくことで
        # 経路縮小を実現。
        self.node[x] = self.find(_val)
        return self.node[x]

    def same(self, x, y):
        """
        xとyが属するグループが同じかチェック。
        """
        return self.find(x) == self.find(y)

    def size(self, x):
        """
        xが属するグループの総サイズ取得
        """
        return abs(self.node[self.find(x)])
 
    def __str__(self):
        return str(self.node)

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

uf = UnionFind(N)
friend = [0] * N
block = [[] for _ in range(N)]

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

for _ in range(K):
    c, d = map(int, input().split())
    c, d = c - 1, d - 1
    block[c].append(d)
    block[d].append(c)

for i in range(N):
    ans = uf.size(i) - friend[i] - 1
    for j in block[i]:
        if uf.same(i, j):
            ans -= 1
    print("{} ".format(ans), end="")
print("")

N,M,K=map(int,input().split())
par=[-1]*N
def find(x):
  if par[x] < 0:
    return x
  else:
    tank = []
    while par[x] >= 0:
      tank.append(x)
      x = par[x]
    for elt in tank:
      par[elt] = x
    return x
def unite(x,y):
  x = find(x)
  y = find(y)
  if x == y:
    return False
  else:
    if find(x)>find(y):x,y=y,x
    par[x] += par[y]
    par[y] = x
    return True
frbl=[0]*N
for i in range(M):
  a,b=sorted(map(int,input().split()))
  unite(a-1,b-1)
  frbl[a-1]+=1;frbl[b-1]+=1
for i in range(K):
  c,d=sorted(map(int,input().split()))
  if find(c-1)==find(d-1):
    frbl[c-1]+=1;frbl[d-1]+=1
    
list=[]
for i in range(N):
  list.append(-par[find(i)]-frbl[i]-1)
print(*list)


class UnionFind:
    # 各要素の親要素の番号を格納するリスト
    # 要素が根（ルート）の場合は-(そのグループの要素数)を格納する
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    # 要素xが属するグループの根を返す
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    # 要素xが属するグループと要素yが属するグループとを併合する
    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

    # 要素xが属するグループのサイズ（要素数）を返す
    def size(self, x):
        return -self.parents[self.find(x)]

    # 要素x, yが同じグループに属するかどうかを返す
    def is_same(self, x, y):
        return self.find(x) == self.find(y)

    # 要素xが属するグループに属する要素をリストで返す
    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()}

    # ルート要素: [そのグループに含まれる要素のリスト]を文字列で返す (print()での表示用)
    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def resolve():
    N, M, K = list(map(int, input().split()))
    uf = UnionFind(N)
    sub_friend = [1] * N  # +1: 自分自身

    frind = [[] for _ in range(N)]
    for _ in range(M):
        a, b = [int(x) - 1 for x in input().split()]
        frind[a].append(b)
        frind[b].append(a)
        sub_friend[a] += 1
        sub_friend[b] += 1

    block = [[] for _ in range(N)]
    for _ in range(K):
        c, d = [int(x) - 1 for x in input().split()]
        block[c].append(d)
        block[d].append(c)

    for i in range(N):
        for to in frind[i]:
            uf.union(i, to)

    ans = [uf.size(i) - sub_friend[i] for i in range(N)]

    for i in range(N):
        for bl in block[i]:
            if uf.is_same(i, bl):
                ans[i] -= 1
    print((*ans))


def __starting_point():
    resolve()

__starting_point()

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

friends = [set() for _ in range(N)]
for _ in range(M):
    a,b = [int(x)-1 for x in input().split()]
    friends[a].add(b)
    friends[b].add(a)

blocks = [set() for _ in range(N)]
for _ in range(K):
    c,d = [int(x)-1 for x in input().split()]
    blocks[c].add(d)
    blocks[d].add(c)

ans = [0]*N
visited = [False]*N
for i in range(N):
    if visited[i]:
        continue
    visited[i] = True
    d = [i]
    check = {i} 
    while len(d):
        tmp = d.pop()
        for k in friends[tmp]:
            if visited[k]:
                continue
            d.append(k)
            visited[k] = True
            check.add(k)
    for j in check:
        ans[j] += len(check) - len(friends[j]&check) - len(blocks[j]&check) - 1
print((*ans))


class Unionfind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * (n+1)
        
    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 = map(int, input().split())
uf = Unionfind(N)
f = [0 for _ in range(N)]
n = [0 for _ in range(N)]

for _ in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    uf.union(a, b)
    
    f[a] += 1
    f[b] += 1
    
for _ in range(K):
    c, d = map(int, input().split())
    c -= 1
    d -= 1
    if(uf.same(c, d)):
        n[c] += 1
        n[d] += 1
    
ans = []
for i in range(N):
    ans.append(uf.size(i)-f[i]-n[i]-1)
    
print(*ans)

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

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

    def unite(self, u, v):
        u = self.find(u)
        v = self.find(v)

        if u == v:
            return

        if self.parents[u] > self.parents[v]:
            u, v = v, u

        self.parents[u] += self.parents[v]
        self.parents[v] = u

    def size(self, v):
        return -self.parents[self.find(v)]

    def same(self, u, v):
        return self.find(u) == self.find(v)

N, M, K = map(int, input().split())
uf = UnionFind(N+1)
F = [0] * (N+1)
B = [0] * (N+1)
for _ in range(M):
    a, b = map(int, input().split())
    uf.unite(a, b)
    F[a] += 1
    F[b] += 1

for _ in range(K):
    c, d = map(int, input().split())
    if uf.same(c, d):
        B[c] += 1
        B[d] += 1

for i in range(1, N+1):
    ans = uf.size(i) - F[i] - B[i] - 1
    print(ans, end=' ')

print()

# unionfind
class Uf:
    def __init__(self, N):
        self.p = list(range(N))
        self.rank = [0] * N
        self.size = [1] * N

    def root(self, x):
        if self.p[x] != x:
            self.p[x] = self.root(self.p[x])

        return self.p[x]

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

    def unite(self, x, y):
        u = self.root(x)
        v = self.root(y)

        if u == v: return

        if self.rank[u] < self.rank[v]:
            self.p[u] = v
            self.size[v] += self.size[u]
            self.size[u] = 0
        else:
            self.p[v] = u
            self.size[u] += self.size[v]
            self.size[v] = 0

            if self.rank[u] == self.rank[v]:
                self.rank[u] += 1

    def count(self, x):
        return self.size[self.root(x)]

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)]

uf = Uf(N+1)
M = [-1] * (N+1)
for a, b in AB:
    uf.unite(a, b)
    M[a] -= 1
    M[b] -= 1
for c, d in CD:
    if uf.same(c, d):
        M[c] -= 1
        M[d] -= 1
for i in range(1, N+1):
    M[i] += uf.count(i)
print((" ".join(map(str, M[1:]))))


import sys
sys.setrecursionlimit(10**6)
from collections import Counter

def dfs(nw):
    for nx in F[nw]:
        if V[nx]==-1:
            V[nx] = cnt
            dfs(nx)

n, m, k = list(map(int, sys.stdin.readline().split()))
F = [[] for _ in range(n)]
B = [[] for _ in range(n)]
for i in range(m):
    a,b = map(lambda x: int(x)-1, map(int, sys.stdin.readline().split()))
    F[a].append(b)
    F[b].append(a)
for i in range(k):
    c,d = map(lambda x: int(x)-1, map(int, sys.stdin.readline().split()))
    B[c].append(d)
    B[d].append(c)

V = [-1]*n
cnt = 1
for i in range(n):
    if V[i]==-1:
        V[i] = cnt
        dfs(i)
        cnt += 1
cV = Counter(V)
ans = []
for i in range(n):
    ans.append(cV[V[i]]-1 - len(F[i]) - sum([V[b]==V[i] for b in B[i]]))

print(*ans)

class UnionFind():
    def __init__(self, n):
        self.n = n
        #親の添字、親自身は木の要素数*-1をもつ
        self.root = [-1]*(n)
        #枝の最大長さ
        self.rank = [0]*(n)

    def find_root(self, x):
        if(self.root[x] < 0):
            return x
        else:
            self.root[x] = self.find_root(self.root[x])
            return self.root[x]
    #高さによる合併    
    def unite(self, x, y):
        x = self.find_root(x)
        y = self.find_root(y)
        if x == y:
            return 
        elif self.rank[x] > self.rank[y]:
            self.root[x] += self.root[y]
            self.root[y] = x

        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            if(self.rank[x] == self.rank[y]):
                self.rank[y] += 1
    def same(self, x, y):
        return self.find_root(x) == self.find_root(y)
    
    def count(self, x):
        return -self.root[self.find_root(x)]    
    
    def members(self, x):
        root = self.find_root(x)
        return [i for i in range(self.n) if self.find_root(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.root) 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()}

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

u = UnionFind(N)
for a,b in AB:
    u.unite(a-1,b-1)

ans=[u.count(i)-1 for i in range(N)] #木の要素数から自分を引く
ans

for a,b in AB:
    if u.same(a-1,b-1):
        ans[a-1]-=1
        ans[b-1]-=1

for c,d in CD:
    if u.same(c-1,d-1):
        ans[c-1]-=1
        ans[d-1]-=1
print(*ans)

class UnionFind():
    """
        unionfindtree のクラス
            グループを管理するデータ構造.
            全てのメソッドの計算量が O(log(n)) よりも小さい
        init: 管理対象の個数 n を用いて初期化
        find: ある要素 x の親がどの要素か返す
        union: ある要素 x と y が属しているグループを結合して1つのグループとする
        msize: ある要素 x が属するグループの大きさを返す
    """
    def __init__(self, n):
        self.n = n
        self.parents = [-1]*n
        self.rank = [0]*n
        self.size = [1]*n

    def find(self, x):
        """
            ある要素 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, y の属するグループを結合するメソッド
            x と y のランク(子の数)の小さい方が結合先の親となる
        """
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.rank[x] < self.rank[y]:
            self.size[y] += self.size[x]
            self.parents[x] = y
        else:
            self.size[x] += self.size[y]
            self.parents[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def msize(self, x):
        """
            ある要素 x の属するグループの大きさを返すメソッド
        """
        return self.size[self.find(x)]

def main():
    N, M, K = list(map(int, input().split()))
    uf = UnionFind(N)
    friends = [0] * N
    for _ in range(M):
        A, B = list(map(int, input().split()))
        uf.union(A-1, B-1)
        friends[A-1] += 1
        friends[B-1] += 1
    for _ in range(K):
        C, D = list(map(int, input().split()))
        if uf.find(C-1) == uf.find(D-1):
            friends[C-1] += 1
            friends[D-1] += 1
    ans = []
    for i in range(N):
        ans.append(uf.msize(i) - friends[i] - 1)
    print((*ans))

def __starting_point():
    main()

__starting_point()

N,M,K=list(map(int,input().split()))
root=[i for i in range(N)]
height=[1 for i in range(N)]
l=[set() for i in range(N)]
mem=[0]*N
def find(n):
   f=n
   while n != root[n]:
      n=root[n]
   root[f]=n
   return n
def union(a,b):
   A=find(a)
   B=find(b)
   if A==B:
      return
   elif height[A]<height[B]:
      height[B]+=height[A]
      height[A]=0
      root[A]=B
   else:
      root[B]=A
      height[A]+=height[B]
      height[B]=0
def same(a,b):
   A=find(a)
   B=find(b)
   if A==B:
      l[a].add(b)
      l[b].add(a)
for i in range(M):
   a,b=list(map(int,input().split()))
   a-=1;b-=1
   l[a].add(b)
   l[b].add(a)
   union(a,b)
for j in range(K):
   a,b=list(map(int,input().split()))
   a-=1;b-=1
   same(a,b)
for i in range(N):
   print(height[find(i)]-len(l[i])-1,end=" ")


def main():
    n,m,k = list(map(int,input().split()))
    F,B = {},{}
    for i in range(1,n+1):
        F[i] = []
        B[i] = []
    for _ in range(m):
        a,b = list(map(int,input().split()))
        F[a]+=[b]
        F[b]+=[a]
    for _ in range(k):
        a,b = list(map(int,input().split()))
        B[a]+=[b]
        B[b]+=[a]
    G = [0 for i in range(n)]
    g = 1
    M = {}
    for i in range(n):
        if G[i]!=0:
            continue
        m = 1
        G[i] = g
        que = [i+1]
        while len(que)>0:
            q = que.pop(0)
            for nv in F[q]:
                if G[nv-1]!=0:
                    continue
                G[nv-1]=g
                que.append(nv)
                m+=1
        M[g] = m
        g += 1
    ans = []
    for i in range(n):
        g = G[i]
        a = M[g]
        for b in B[i+1]:
            if G[b-1]==g:
                a -=1
        a -= len(F[i+1])
        a -= 1
        ans.append(a)
    print((' '.join([str(a) for a in ans])))

def __starting_point():
    main()

__starting_point()

import sys
sys.setrecursionlimit(100000000)
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=map(int,input().split())
block = [0]*n
uf = UnionFind(n)
for _ in range(m):
  a,b=map(int,input().split())
  block[a-1] += 1
  block[b-1] += 1
  uf.union(a-1,b-1)

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

ans = [uf.size(i) - block[i] - 1 for i in range(n)]
print(*ans)

N,M,K=map(int,input().split())
par=[-1]*N
def find(x):
    if par[x] < 0:
        return x
    else:
        tank = []
        while par[x] >= 0:
            tank.append(x)
            x = par[x]
        for elt in tank:
            par[elt] = x
        return x
def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y:
        return False
    else:
      if find(x)>find(y):x,y=y,x
      par[x] += par[y]
      par[y] = x
      return True
frbl=[0]*N
for i in range(M):
  a,b=sorted(map(int,input().split()))
  unite(a-1,b-1)
  frbl[a-1]+=1;frbl[b-1]+=1
block=[0]*N
for i in range(K):
  c,d=sorted(map(int,input().split()))
  if find(c-1)==find(d-1):
    frbl[c-1]+=1;frbl[d-1]+=1
list=[]
for i in range(N):
  list.append(-par[find(i)]-frbl[i]-1)
print(*list)

n,m,k=map(int,input().split())

class UnionFind:
    def __init__(self,n):
        self.ps = [-1]*(n+1)
    def find(self,x):
        if self.ps[x]<0:
            return x
        else:
            self.ps[x]=self.find(self.ps[x])
            return self.ps[x]
    def unite(self,x,y):
        x=self.find(x)
        y=self.find(y)
        if x==y:
            return False
        if self.ps[x]>self.ps[y]:
            x,y = y,x
        self.ps[x] += self.ps[y]
        self.ps[y] = x
        return True
    def same(self,x,y):
        return self.find(x)==self.find(y)
    def size(self,x):
        x = self.find(x)
        return -self.ps[x]

all1 = [0]*(n)

uf = UnionFind(n)
for i in range(m):
    a,b = map(int,input().split())
    uf.unite(a,b)
    a,b = a-1,b-1
    
    all1[a] +=1
    all1[b] +=1
#print(all1)
ans = [uf.size(x)-1-all1[x-1] for x in range(1,n+1)]
#print(ans)

for i in range(k):
    a,b = map(int,input().split())
    if uf.same(a,b):
        a,b = a-1,b-1
        ans[a] -=1
        ans[b] -=1
print(*ans)

N, M, K = list(map(int, input().split()))
p = [0] * N # p[][0] 友達リスト　p[][1] ブロックリスト p[][2] 所属グループ(-1はなし)
for i in range(N):
    p[i] = [0]*3
    p[i][0] = []
    p[i][1] = []
    p[i][2] = -1
g = [] # グループのサイズ
stack = []
groupNum = 0
fcs = []

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

def groupmake(person,group):
    groupSize = 0
    stack.append(person)
    p[person][2] = group
    while True:
        num = stack.pop()
        groupSize += 1
        for i in p[num][0]:
            if p[i][2] == -1:
                stack.append(i)
                p[i][2] = group
        if len(stack) == 0:
            return groupSize

for i in range(len(p)):
    if p[i][2] == -1:
        g.append(groupmake(i, groupNum))
        groupNum += 1

for person in p:
    fcs.append(g[person[2]] - len(person[0]) -1)

for i in range(K):
    c, d = list(map(int, input().split()))
    if p[c-1][2] == p[d-1][2]:
        fcs[c-1] -= 1
        fcs[d-1] -= 1

print(" ".join(map(str, fcs)))

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 = map(int, input().split())
uf = UnionFind(n)
friend = [0]*n

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

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

ans = [0]*n
for i in range(n):
    ans[i] = uf.size(i) - friend[i] - 1

print(*ans)

import math
from math import gcd,pi,sqrt
INF = float("inf")
MOD = 10**9 + 7

import sys
sys.setrecursionlimit(10**6)
import itertools
import bisect
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
  class UnionFind:
        def __init__(self, n):
            self.par = [i for i in range(n+1)]
            self.rank = [0] * (n+1)
            self.size = [1] * (n+1)
    
        # 検索
        def find(self, x):
            if self.par[x] == x:
                return x
            else:
                self.par[x] = self.find(self.par[x])
                return self.par[x]
    
        # 併合
        def union(self, x, y):
            x = self.find(x)
            y = self.find(y)
    
            if x == y:
                return
    
            if self.rank[x] < self.rank[y]:
                self.par[x] = y
                self.size[y] += self.size[x]
                self.size[x] = 0
            else:
                self.par[y] = x
                self.size[x] += self.size[y]
                self.size[y] = 0
                if self.rank[x] == self.rank[y]:
                    self.rank[x] += 1
    
        # 同じ集合に属するか判定
        def same(self, x, y):
            return self.find(x) == self.find(y)
    
        # すべての頂点に対して親を検索する
        def all_find(self):
            for n in range(len(self.par)):
                self.find(n)


  N,M,K = i_map()
  tree = UnionFind(N)
  not_friend_candi = []

  for i in range(M):
    A,B = i_map()
    A -= 1
    B -= 1
    tree.union(A,B)
    not_friend_candi.append([A,B])
  
  tree.all_find()

  for j in range(K):
    C,D = i_map()
    C -= 1
    D -= 1
    not_friend_candi.append([C,D])
  
  ans = [0]*N
  for i,j in not_friend_candi:
    if tree.same(i,j):
      ans[i] -= 1
      ans[j] -= 1
  for i in range(N):
    p = tree.find(i)
    ans[i] += tree.size[p] - 1
  print(*ans)



 


def __starting_point():
    main()
__starting_point()

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 = map(int, input().split())
ans = [-1 for _ in range(n)]
UF = UnionFind(n)
for _ in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    UF.union(a, b)
    ans[a] -= 1
    ans[b] -= 1
    
for i in range(n):
    ans[i] += UF.size(i)

for _ in range(k):
    c, d = map(int, input().split())
    c -= 1
    d -= 1
    if UF.same(c, d):
        ans[c] -= 1
        ans[d] -= 1
print(*ans)

class UnionFind():
    def __init__(self, n):
        self.parents = list(range(n))
        self.size = [1] * n
    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 union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.size[x] < self.size[y]:
            self.size[y] += self.size[x]
            self.parents[x] = y
        else:
            self.size[x] += self.size[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)
friends=[0]*n
for i in range(m):
    a,b=list(map(int,input().split()))
    uf.union(a-1,b-1)
    friends[a-1]+=1
    friends[b-1]+=1
block=[[] for _ in range(n)]
for i in range(k):
    c,d=list(map(int,input().split()))
    block[c-1].append(d)
    block[d-1].append(c)
ans=[0]*n
cnt=[0]*n
for i in range(n):
    cnt[i]=uf.find(i)
for i in range(n):
    num1=uf.size[uf.find(i)]-friends[i]-1
    num2=cnt[i]
    for j in range(len(block[i])):
        if num2==cnt[block[i][j]-1]:
            num1-=1
    ans[i]=num1
print((*ans))


class UnionFind:
    def __init__(self, N):
        self.root = list(range(N + 1))
        self.size = [1] * (N + 1)

    def __getitem__(self, x):
        root = self.root
        while root[x] != x:
            root[x] = root[root[x]]
            x = root[x]
        return x

    def merge(self, x, y):
        x = self[x]
        y = self[y]
        if x == y:
            return
        sx, sy = self.size[x], self.size[y]
        if sx < sy:
            x, y = y, x
            sx, sy = sy, sx
        self.root[y] = x
        self.size[x] += sy


def graph_input(N, M):
    G = [[] for _ in range(N + 1)]
    for _ in range(M):
        a, b = list(map(int, input().split()))
        G[a].append(b)
        G[b].append(a)
    return G


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

uf = UnionFind(N + 1)
for a in range(N + 1):
    for b in friend[a]:
        uf.merge(a, b)

answer = [0] * (N + 1)
for a in range(N + 1):
    n = uf.size[uf[a]] - 1
    for x in friend[a] + block[a]:
        if uf[a] == uf[x]:
            n -= 1
    answer[a] = n

print((' '.join(map(str, answer[1:]))))


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 = map(int, input().split())
fr = [0]*n
uf_fr = UnionFind(n)

for i in range(m):
    a, b = map(int, input().split())
    uf_fr.union(a-1, b-1)
    fr[a-1] += 1
    fr[b-1] += 1

for i in range(k):
    c, d = map(int, input().split())
    if uf_fr.find(c-1) == uf_fr.find(d-1):
        fr[c-1] += 1
        fr[d-1] += 1

ans_list = []
for i in range(n):
    ans_list.append(uf_fr.size(i) - fr[i] - 1)
print(*ans_list)

# ABC157 D Friend Suggestions
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)

n,m,k = map(int,input().split())
g = [[] for _ in range(n)]
uf = UnionFind(n)

for i in range(m):
    a,b = map(int,input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)
    uf.union(a-1,b-1)
    
for i in range(k):
    c,d = map(int,input().split())
    if uf.same(c-1,d-1):
        g[c-1].append(d-1)
        g[d-1].append(c-1)
        
ans = [0]*n
for i in range(n):
    ans[i] = uf.size(i) - len(g[i]) - 1
print(*ans)

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

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())
      
uf = UnionFind(N)      
V = [[] for _ in range(N)]

for _ in range(M):
  a,b = list(map(int, input().split()))
  a,b = a-1, b-1
  V[a].append(b)
  V[b].append(a)
  uf.union(a,b)
  
for _ in range(K):
  a,b = list(map(int, input().split()))
  a,b = a-1, b-1
  if uf.same(a,b):
    V[a].append(b)
    V[b].append(a)

ans = [-1] * N
for i in range(N):
  ans[i] = uf.size(i) - len(V[i]) - 1
  
print((" ".join(list(map(str, ans)))))



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=map(int,input().split())
tree=UnionFind(N)
not_friend_candidates=[]

for i in range(M):
  A,B=list(map(int,input().split()))
  A-=1
  B-=1
  tree.union(A,B)
  not_friend_candidates.append([A,B])

for j in range(K):
  C,D=list(map(int,input().split()))
  C-=1
  D-=1
  not_friend_candidates.append([C,D])


ans=[0]*N
for i,j in not_friend_candidates:
  if tree.same(i,j):
    ans[i]-=1
    ans[j]-=1
for i in range(N):
  ans[i]+=tree.size(i)-1
print(*ans)

from collections import deque, Counter
import sys

N_MAX = 100000 + 5
sys.setrecursionlimit(N_MAX)

N, M, K = map(int, sys.stdin.readline().rstrip().split())

fr = [[] for _ in range(N)]  # 友達関係
for _ in range(M):
    a, b = map(int, sys.stdin.readline().rstrip().split())
    fr[a - 1].append(b - 1)
    fr[b - 1].append(a - 1)

bl = [[] for _ in range(N)]  # ブロック関係
for _ in range(K):
    a, b = map(int, sys.stdin.readline().rstrip().split())
    bl[a - 1].append(b - 1)
    bl[b - 1].append(a - 1)


gr = [0] * N  # 友達候補グループ


# ## BFS ## #
def bfs(u, num):

    q = deque()
    q.append(u)
    gr[u] = num
    while q:
        u = q.popleft()
        for v in fr[u]:
            if gr[v] == 0:  # state を確認
                gr[v] = num  # state を変更
                q.append(v)


num = 1
for i in range(N):
    if gr[i] == 0:
        bfs(i, num)
        num += 1

# print(gr)

gr_num = Counter(gr)  # グループの人数を数えておく


# グループの中から、友達でも
ans = []
for i in range(N):
    kouho_suu = gr_num[gr[i]]
    for f in fr[i]:
        if gr[i] == gr[f]:
            kouho_suu -= 1
    for b in bl[i]:
        if gr[i] == gr[b]:
            kouho_suu -= 1
    kouho_suu -= 1

    ans.append(kouho_suu)

print(*ans)

n,m,k=map(int,input().split())

par = [-1]*n
num = [0]*n

def find(x):
    if par[x]<0:
        return x
    else:
        par[x] = find(par[x])
        return par[x]

def union(x, y):
    p,q=find(x), find(y)
    if p==q:
        return
    if p>q:
        p,q = q,p
    par[p] += par[q]
    par[q] = p

def size(x):
    return -par[find(x)]

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

for i in range(m):
    a,b=map(int,input().split())
    a-=1
    b-=1
    union(a,b)
    num[a]+=1
    num[b]+=1

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

for i in range(n):
    print(size(i)-1-num[i], end=" ")

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 = map(int, input().split())
a = [list(map(int, input().split())) for i in range(m)]
b = [0]*n
uf = UnionFind(n)
for i in range(m):
    uf.union(a[i][0]-1, a[i][1]-1)
for i in range(m+k):
    x = list(map(int, input().split())) if i >= m else a[i]
    if uf.same(x[0]-1, x[1]-1):
        b[x[0]-1] += 1
        b[x[1]-1] += 1
for i in range(n):
    print(uf.size(i)-1-b[i],end=" ")

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=map(int,input().split())
friend=[[] for _ in range(n)]
block=[[] for _ in range(n)]
a=UnionFind(n)
for i in range(m):
    x,y=map(int,input().split())
    friend[x-1].append(y-1)
    friend[y-1].append(x-1)
    a.union(x-1,y-1)
for i in range(k):
    x,y=map(int,input().split())
    block[x-1].append(y-1)
    block[y-1].append(x-1)
ans=[]
for i in range(n):
    ans.append(a.size(i)-len(friend[i])-sum(a.same(i,j) for j in block[i])-1)
print(*ans)

import numpy as np
from scipy.sparse.csgraph import connected_components
from scipy.sparse import csr_matrix

import sys
sys.setrecursionlimit(10**9)
n,m,k=[int(i) for i in input().split()]
frends_num=[0 for i in range(n)]
def make_frends(m,n):
    data=[1 for i in range(m)]

    row=[]
    col=[]
    for k in range(m):
        i,j=[int(l) for l in input().split()]
        new_i=min(i,j)-1
        new_j=max(i,j)-1
        row.append(new_i)
        col.append(new_j)
        frends_num[new_i]+=1
        frends_num[new_j]+=1
    frend_sparce_matrix=csr_matrix((data, (row, col)),shape=(n,n))
    return frend_sparce_matrix


frends=make_frends(m,n)
l,labels=connected_components(frends)
labels
labels=list(labels)

class Group:
    def __init__(self,labels):
        self.labels=labels
        self.group_num=[0 for i in range(l)]
        for i in labels:
            self.group_num[i]+=1
    def get_group_num(self,i):
        return self.group_num[self.labels[i]]

group=Group(labels)


def get_frend_num(i):
    return frends_num[i]


def make_block(k,n):
    block_num=[0 for i in range(n)]
    for p in range(k):
        i,j =[int(l)-1 for l in input().split()]
        new_i=min(i,j)
        new_j=max(i,j)
        if labels[new_i]==labels[new_j]:
            block_num[i]+=1
            block_num[j]+=1
    return block_num

block=make_block(k,n)

def get_block_num(i):
    return block[i]

ans=[]
for i in range(n):
    ans.append(str(group.get_group_num(i)-1-get_frend_num(i)-get_block_num(i)))
print((" ".join(ans)))


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

import sys
sys.setrecursionlimit(10**9) #再帰の上限をあげる

root=[-1 for i in range(n+1)] #自分が親ならグループの人数のマイナス倍を、そうでないなら（元）親の番号を示す

def r(x):   #親は誰？
    if root[x]<0:
        return x
    else:
        root[x]=r(root[x])
        return root[x]

def unite(x,y):
    x=r(x)
    y=r(y)
    if x==y:
        return
    if x>y:
        x,y=y,x
    root[x]+=root[y]
    root[y]=x


fre=[[] for _ in range(n+1)]
bro=[[] for _ in range(n+1)]

for i in range(m):
    a,b=list(map(int,input().split()))
    unite(a,b)
    fre[a].append(b)
    fre[b].append(a)

for i in range(k):
    a, b = list(map(int, input().split()))
    bro[a].append(b)
    bro[b].append(a)

ans=[]
for i in range(1,n+1):
    anser=-root[r(i)]-1
    anser-=len(fre[i])
    for j in bro[i]:
        if r(i)==r(j):
            anser-=1
    ans.append(str(anser))
print((" ".join(ans)))




from collections import Counter

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)]

friend_g = [set() for i in range(N)]
for a, b in AB:
    a, b = a-1, b-1
    friend_g[a].add(b)
    friend_g[b].add(a)
friend_count = [len(s) for s in friend_g]

g_nums = [-1]*N
current_g_num = 0
for i in range(N):
    if g_nums[i] == -1:
        g_nums[i] = current_g_num
        q = [i]
        while q:
            t = q.pop()
            for friend in friend_g[t]:
                if g_nums[friend] == -1:
                    g_nums[friend] = current_g_num
                    q.append(friend)
                # print(i, t, g_nums)
        current_g_num += 1

block_count = [0]*N
for c, d in CD:
    c, d = c-1, d-1
    if g_nums[c] == g_nums[d]:
        block_count[c] += 1
        block_count[d] += 1

g_nums_counter = Counter(g_nums)
print((*(g_nums_counter[g_nums[i]] - friend_count[i] - block_count[i] - 1 for i in range(N))))


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 = map(int, input().split())
uf = UnionFind(n)
friend = [0]*n
 
for _ in range(m):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    uf.union(a, b)
    friend[a] += 1
    friend[b] += 1
 
for _ in range(k):
    c, d = map(int, input().split())
    c, d = c-1, d-1
    if uf.same(c, d):
        friend[c] += 1
        friend[d] += 1
 
ans = [0]*n
for i in range(n):
    ans[i] = uf.size(i) - friend[i] - 1
 
print(*ans)

class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

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

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y] 

    def is_same(self, x, y):
        return self.find(x) == self.find(y)
      
    def get_size(self, x):
        x = self.find(x)
        return self.size[x]

n,m,k=map(int,input().split())
uf=UnionFind(n+1)
cnt=[0]*(n+1)
for _ in range(m):
  a,b=map(int,input().split())
  uf.union(a,b)
  cnt[a]+=1
  cnt[b]+=1
for _ in range(k):
  c,d=map(int,input().split())
  if uf.is_same(c,d):
    cnt[c]+=1
    cnt[d]+=1
for i in range(1,n+1):
  print(uf.get_size(i)-cnt[i]-1,end=' ')

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+1)
AB_list = []

for i in range(M):
    A, B = list(map(int, input().split()))
    AB_list.append([A, B])
    uf.union(A, B)

dame = [[] for i in range(N+1)]
for i in range(M):
    if uf.same(AB_list[i][0], AB_list[i][1]):
        dame[AB_list[i][0]].append(AB_list[i][1])
        dame[AB_list[i][1]].append(AB_list[i][0])

for i in range(K):
    C, D = list(map(int, input().split()))
    if uf.same(C, D):
        dame[C].append(D)
        dame[D].append(C)

ans_list = []
for i in range(1, N+1):
    ans_list.append(uf.size(i) - len(dame[i]) - 1)
    #print(ans, uf.size(i), len(dame[i]))
print((*ans_list))


import sys
input = sys.stdin.readline

class UnionFind:
    def __init__(self, numV):
        self.pars = list(range(numV))
        self.ranks = [0] * numV
        self.sizes = [1] * numV
    def getRoot(self, x):
        par = self.pars[x]
        if par != x:
            self.pars[x] = par = self.getRoot(par)
        return par
    def merge(self, x, y):
        x, y = self.getRoot(x), self.getRoot(y)
        sx, sy = self.sizes[x], self.sizes[y]
        if x == y: return (0, 0)
        if self.ranks[x] < self.ranks[y]:
            self.pars[x] = y
            self.sizes[y] += sx
        else:
            self.pars[y] = x
            self.sizes[x] += sy
            if self.ranks[x] == self.ranks[y]:
                self.ranks[x] += 1
        return (sx, sy)
    def isSame(self, x, y):
        return self.getRoot(x) == self.getRoot(y)
    def updatePars(self):
        for v in range(len(self.pars)):
            self.getRoot(v)
    def getSize(self, x):
        return self.sizes[self.getRoot(x)]

N, M, K = list(map(int, input().split()))
UF = UnionFind(N)
anss = [-1] * N
for _ in range(M):
    A, B = list(map(int, input().split()))
    A, B = A-1, B-1
    UF.merge(A, B)
    anss[A] -= 1
    anss[B] -= 1

for i in range(N):
    anss[i] += UF.getSize(i)

for _ in range(K):
    C, D = list(map(int, input().split()))
    C, D = C-1, D-1
    if UF.isSame(C, D):
        anss[C] -= 1
        anss[D] -= 1

print((' '.join(map(str, anss))))


import sys
sys.setrecursionlimit(10**9)
n,m,k=map(int,input().split())
friend=[[] for _ in range(n)]
block=[[] for _ in range(n)]
for _ in range(m):
    a,b=map(int,input().split())
    a-=1
    b-=1
    friend[a].append(b)
    friend[b].append(a)
for _ in range(k):
    c,d=map(int,input().split())
    c-=1
    d-=1
    block[c].append(d)
    block[d].append(c)
seen=[-1]*n
def dfs(graph,v,top):
    seen[v]=top
    top_count[top]+=1
    for nv in graph[v]:
        if seen[nv]!=-1:
            continue
        dfs(graph,nv,top)
top=0
top_count=[0]
for v in range(n):
    count=0
    if seen[v]!=-1:
        continue
    dfs(friend,v,top)
    top_count.append(0)
    top+=1


for i in range(n):
    ans=top_count[seen[i]]-len(friend[i])-1
    cnt=0
    for v in block[i]:
        if seen[v]==seen[i]:
            cnt+=1
    ans-=cnt
    print(ans,end=' ')

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()))


friends = UnionFind(n)
direct_friends = [0] * n
enemies = [[] for _ in range(n)]

for i in range(m):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    direct_friends[a] += 1
    direct_friends[b] += 1
    friends.union(a, b)

for i in range(k):
    c, d = list(map(int, input().split()))
    c -= 1
    d -= 1
    enemies[c].append(d)
    enemies[d].append(c)

ans = []
for i in range(n):
    num = friends.size(i) - 1 - direct_friends[i]
    for enm in enemies[i]:
        if friends.same(i, enm):
            num -= 1
    ans.append(num)

print((*ans))



from collections import deque

N, M, K = list(map(int, input().split()))
friend = [list(map(int, input().split())) for _ in range(M)]
block = [list(map(int, input().split())) for _ in range(K)]

f = [set() for _ in range(N + 1)]
b = [set() for _ in range(N + 1)]

for i, j in friend:
    f[i].add(j)
    f[j].add(i)
for i, j in block:
    b[i].add(j)
    b[j].add(i)

stack = deque()
ans = [0] * (N + 1)
visited = [0] * (N + 1)

for i in range(1, N + 1):
    if visited[i]:
        continue
    # setは{}で書く
    link = {i}
    stack.append(i)
    visited[i] = 1
    while stack:
        n = stack.pop()
        # nのフレンド全員について
        for j in f[n]:
            if visited[j] == 0:
                stack.append(j)
                visited[j] = 1
                # link(set)に追加
                link.add(j)
    for i in link:
        # 全体-既にフレンドの人数-ブロックした人数-自分自身
        # set同士で積集合をとる
        ans[i] = len(link) - len(link & f[i]) - len(link & b[i]) - 1

print((*ans[1:]))


#!/usr/bin/env python
# coding: utf-8

# In[14]:


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())


# In[ ]:


N,M,K=list(map(int,input().split()))
tree=UnionFind(N)
not_friend_candidates=[]


# In[ ]:


for i in range(M):
  A,B=list(map(int,input().split()))
  A-=1
  B-=1
  tree.union(A,B)
  not_friend_candidates.append([A,B])

for j in range(K):
  C,D=list(map(int,input().split()))
  C-=1
  D-=1
  not_friend_candidates.append([C,D])


ans=[0]*N
for i,j in not_friend_candidates:
  if tree.same(i,j):
    ans[i]-=1
    ans[j]-=1
for i in range(N):
  ans[i]+=tree.size(i)-1
print((*ans))



from collections import deque
f=lambda:list(map(int,input().split()))
r=range
n,m,k=f()
F=[deque([])for _ in r(n)]
A=[0]*n
B=[-1]*n
C=[-1]*n
Q=deque([])
for _ in r(m):a,b=f();a-=1;b-=1;F[a].append(b);F[b].append(a);A[a]+=1;A[b]+=1
for i in r(n):
  Q.append(x:=i)
  y=0
  while Q:
    z=Q.popleft()
    if B[z]>-1:continue
    B[z]=x
    Q.extend(F[z])
    y+=1
  C[x]=y
D=[[B[i],C[B[i]]-A[i]-1]for i in r(n)]
for _ in r(k):
  c,d=f()
  c,d=c-1,d-1
  if D[c][0]==D[d][0]:D[c][1]-=1;D[d][1]-=1
print((*[d[1] for d in D]))


#UnionFind
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 = map(int,input().split())
V = [[] for i in range(n+1)]
W = [0]*(n+1)
uf = UnionFind(n+1)
for _ in range(m):
    a,b = map(int,input().split())
    V[a].append(b)
    V[b].append(a)
    uf.union(a,b)
for _ in range(k):
    c,d = map(int,input().split())
    if uf.find(d) == uf.find(c):
        W[c] += 1
        W[d] += 1
    
for i in range(1,n+1):
    ans = uf.size(i) - len(V[i]) - W[i] - 1
    print(ans,end="")
    print(" ",end="")
print()

class UnionFind():
    def __init__(self, n):
        self.parents = [-1]*n
    
    def root(self, x):
        if self.parents[x] < 0:
            return x
        else:
            return self.root(self.parents[x])
    
    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return
        else:
            if x > y:
                x, y = y, x
            self.parents[x] += self.parents[y]
            self.parents[y] = x
            return

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

u = UnionFind(n)
f = [set() for _ in range(n)]
l = [set() for _ in range(n)]
for a, b in ab:
    a, b = a-1, b-1
    f[a].add(b)
    f[b].add(a)
    u.unite(a, b)
for c, d in cd:
    c, d = c-1, d-1
    l[c].add(d)
    l[d].add(c)
ans = [0] * n
for i in range(n):
    r = u.root(i)
    bl = 0
    for j in l[i]:
        if u.root(j) == r:
            bl += 1
    ans[i] = -u.parents[r] - len(f[i]) - bl - 1
print(*ans)

import sys
from collections import Counter as cc
def input(): return sys.stdin.readline().rstrip()
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(mi())


class UnionFind():
    def __init__(self, n):
        self.parent = [i for i in range(n)]
        self.height = [0]*n

    def get_root(self, i):
        if self.parent[i] == i:
            return i
        else:
            self.parent[i] = self.get_root(self.parent[i])
            return self.parent[i]
        
    def unite(self, i, j):
        root_i = self.get_root(i)
        root_j = self.get_root(j)
        if root_i != root_j:
            if self.height[root_i] < self.height[root_j]:
                self.parent[root_i] = root_j
            else:
                self.parent[root_j] = root_i
                if self.height[root_i] == self.height[root_j]:
                    self.height[root_i] += 1
    
    def is_in_group(self, i, j):
        if self.get_root(i) == self.get_root(j):
            return True
        else:
            return False


def main():
    n, m, k= mi()   
    e = [0]*n
    uf = UnionFind(n)     
    for i in range(m):
        a, b = mi()
        a-=1
        b-=1
        e[a]-= 1
        e[b]-= 1
        uf.unite(a,b)
    
    
    for _ in range(k):
        a,b = mi()
        a-=1
        b-=1
        if uf.is_in_group(a,b):
            e[a] -= 1
            e[b] -= 1
        
    for i in range(n):
        uf.get_root(i)
    s = cc(uf.parent)
    for i in range(n):
        x = uf.get_root(i)
        e[i] += s[x]-1
    print(*e)




def __starting_point():
    main()
__starting_point()

from collections import Counter
 
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)]
 
friend_g = [set() for i in range(N)]
for a, b in AB:
    a, b = a-1, b-1
    friend_g[a].add(b)
    friend_g[b].add(a)
friend_count = [len(s) for s in friend_g]
 
g_nums = [-1]*N
current_g_num = 0
for i in range(N):
    if g_nums[i] == -1:
        g_nums[i] = current_g_num
        q = [i]
        while q:
            t = q.pop()
            for friend in friend_g[t]:
                if g_nums[friend] == -1:
                    g_nums[friend] = current_g_num
                    q.append(friend)
                # print(i, t, g_nums)
        current_g_num += 1
 
block_count = [0]*N
for c, d in CD:
    c, d = c-1, d-1
    if g_nums[c] == g_nums[d]:
        block_count[c] += 1
        block_count[d] += 1
 
g_nums_counter = Counter(g_nums)
print(*(g_nums_counter[g_nums[i]] - friend_count[i] - block_count[i] - 1 for i in range(N)))

import sys
sys.setrecursionlimit(10**5)

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

F = [[] for _ in range(n+1)]
B = [[] for _ in range(n+1)]

for _ in range(m):
    x,y = list(map(int, input().split()))
    F[x].append(y)
    F[y].append(x)

for _ in range(k):
    x,y = list(map(int, input().split()))
    B[x].append(y)
    B[y].append(x)

belongs = [-1 for _ in range(n+1)]
group_ID = 0

def f_search(root, group_ID):
    for j in F[root]:
        if belongs[j] == -1:
            belongs[j] = group_ID
            f_search(j, group_ID)

for i in range(n+1):
    if belongs[i] == -1:
        belongs[i] = group_ID
        f_search(i, group_ID)
        group_ID += 1

cnt_members = [0 for _ in range(len(set(belongs)))]
for i in belongs[1:]:
    cnt_members[i] += 1

ans = [0 for _ in range(n+1)]
for i in range(1, n+1):
    tmp = 0
    for j in B[i]:
        if belongs[j] == belongs[i]:
            tmp += 1
    ans[i] = cnt_members[belongs[i]] - 1 - len(F[i]) - tmp

print((*ans[1:]))


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)

n,m,k=map(int,input().split())
uf=UnionFind(n)
friend=[[] for _ in range(n)]
brock=[[] for _ in range(n)]
ans=[]
for _ in range(m):
    a,b=map(int,input().split())
    friend[a-1].append(b-1)
    friend[b-1].append(a-1)
    uf.union(a-1,b-1)
for _ in range(k):
    c,d=map(int,input().split())
    brock[c-1].append(d-1)
    brock[d-1].append(c-1)
for i in range(n):
    ans.append(uf.size(i)-len(friend[i])-sum([uf.same(i,j) for j in brock[i]])-1)
print(*ans)

from collections import deque
import numpy as np

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

friends = [[] for _ in range(N + 1)]
for i in range(M):
    A, B = [int(x) for x in input().split()]
    friends[A].append(B)
    friends[B].append(A)

block = [[] for _ in range(N + 1)]
for i in range(K):
    C, D = [int(x) for x in input().split()]
    block[C].append(D)
    block[D].append(C)

G = []
check = [False] * (N + 1)
for i in range(1, N + 1):
    if check[i] == False:
        check[i] = True
        g = [i]
        q = deque([i])
        while q:
            j = q.popleft()
            for k in friends[j]:
                if check[k] == False:
                    check[k] = True
                    g.append(k)
                    q.append(k)
        G.append(g)

gr = np.array([0] * (N + 1))
fr = np.array([len(friends[i]) for i in range(N + 1)])
bl = np.array([0] * (N + 1))

for g in G:
    s = set(g)
    for v in g:
        gr[v] = len(g)
        b = set(block[v])
        bl[v] = len(s & b)

ans = gr - fr - bl - np.array([1] * (N + 1))

for i in range(1, N + 1):
    print(ans[i], end='')
    if i == N:
        print('')
    else:
        print(' ', end='')