You are given an SNS with N users, some friendships (M) and blockships (K). A user 'a' is a friend candidate for user 'b' if four conditions are met. For each user i, find the number of friend candidates. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ M, K ≤ 10^5, 1 ≤ A_i, B_i, C_i, D_i ≤ N. Input format: N M K, followed by A_i B_i and C_i D_i. Output the number of friend candidates for each user.

# Buggy version:
n,m,k = map(int, input().split())

g = [[] for i in range(n+1)]
f = [0]*(n+1)
b = []
for i in range(m):
  u, v = map(int, input().split())
  g[u].append(v)
  g[v].append(u)
  f[u] += 1
  f[v] += 1
for i in range(k):
  b.append(map(int, input().split()))

count = 0
renketu_list = [-1]*(n+1)
renketu_size = [0]
stack = []
for i in range(1, n+1):
  if renketu_list[i] == -1:
    count += 1
    renketu_list[i] = count
    renketu_size.append(1)
    while len(g[i]) > 0:
      stack.append(g[i].pop())
    while len(stack) > 0:
      u,v=stack.pop()
      if renketu_list[v] == -1:
        renketu_list[v] = count
        renketu_size[count] += 1
        while len(g[v])>0:
          stack.append(g[v].pop())

s = [0] * (n+1)
for i in range(1, n):
  s[i] += renketu_size[renketu_list[i]] + f[i]
  
for i in range(k):
  u, v = b[i]
  if renketu_list[u] == renketu_list[v]:
    s[u] -= 1
    s[v] -= 1

print(" ".join(list(map(str, s))))
  

# Fixed version:
n,m,k = map(int, input().split())

g = [[] for i in range(n+1)]
f = [0]*(n+1)
b = []
for i in range(m):
  u, v = map(int, input().split())
  g[u].append(v)
  g[v].append(u)
  f[u] += 1
  f[v] += 1
for i in range(k):
  b.append(map(int, input().split()))
count = 0
renketu_list = [-1]*(n+1)
renketu_size = [0]
stack = []
for i in range(1, n+1):
  if renketu_list[i] == -1:
    count += 1
    renketu_list[i] = count
    renketu_size.append(1)
    while len(g[i]) > 0:
      stack.append(g[i].pop())
    while len(stack) > 0:
      v=stack.pop()
      if renketu_list[v] == -1:
        renketu_list[v] = count
        renketu_size[count] += 1
        while len(g[v])>0:
          stack.append(g[v].pop())

s = [0] * (n+1)
for i in range(1, n+1):
  s[i] += renketu_size[renketu_list[i]] - f[i] - 1
  
for i in range(k):
  u, v = b[i]
  if renketu_list[u] == renketu_list[v]:
    s[u] -= 1
    s[v] -= 1

print(" ".join(list(map(str, s[1:]))))

# Buggy version:
# coding: utf-8
import sys
sysread = sys.stdin.readline
from collections import defaultdict
sys.setrecursionlimit(10**7)
def run():
    N,M,K = map(int,sysread().split())
    to = [[] for _ in range(N+1)]
    n_to = [0 for _ in range(N + 1)]
    for i in range(1,M+1):
        a,b = map(int, sysread().split())
        #a,b = AB[i]
        to[a].append(b)
        n_to[a] += 1
        to[b].append(a)
        n_to[b] += 1

    stack = defaultdict(lambda:0)
    visited = [False] * (N+1)
    belong = [None] * (N+1)


    def dfs(n):
        _stack = [n]
        visited[n] = True
        while _stack:
            node = _stack.pop()
            stack[n] += 1
            belong[node] = n
            for next in to[node]:
                if not visited[next]:
                    _stack.append(next)
                    visited[next] = True
        return None


    for i in range(1,N+1):
            dfs(i)

    block = [0 for _ in range(N+1)]
    for i in range(1, K+1):
        c,d = map(int, sysread().split())
        #c, d = CD[i]
        if belong[c] == belong[d]:
            block[c] += 1
            block[d] += 1

    candidates = [0] * (N+1)

    for tree in stack.keys():
        for k in range(1,N+1):
            tr = belong[k]
            candidates[k] = stack[tr] - 1 - n_to[k] - block[k]

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

if __name__ == "__main__":
    run()

# Fixed version:
# coding: utf-8
import sys
sysread = sys.stdin.readline
from collections import defaultdict
sys.setrecursionlimit(10**7)
def run():

    N,M,K = map(int,sysread().split())
    to = [[] for _ in range(N+1)]
    n_to = [0 for _ in range(N + 1)]
    for i in range(1,M+1):
        a,b = map(int, sysread().split())
        #a,b = AB[i]
        to[a].append(b)
        n_to[a] += 1
        to[b].append(a)
        n_to[b] += 1

    stack = defaultdict(lambda:0)
    visited = [False] * (N+1)
    belong = [None] * (N+1)


    def dfs(n):
        _stack = [n]
        visited[n] = True
        while _stack:
            node = _stack.pop()
            stack[n] += 1
            belong[node] = n
            for next in to[node]:
                if not visited[next]:
                    _stack.append(next)
                    visited[next] = True
        return None


    for i in range(1,N+1):
        if not visited[i]:
            dfs(i)

    block = [0 for _ in range(N+1)]
    for i in range(1, K+1):
        c,d = map(int, sysread().split())
        #c, d = CD[i]
        if belong[c] == belong[d]:
            block[c] += 1
            block[d] += 1

    candidates = [0] * (N+1)

    for k in range(1,N+1):
        tr = belong[k]
        candidates[k] = stack[tr] - 1 - n_to[k] - block[k]

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

if __name__ == "__main__":
    run()

# Buggy version:
# UnionFind: https://note.nkmk.me/python-union-find/
n, m, k = 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 unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return False
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x
        
    def is_same(self, x, y):
        return self.parents[x] == self.parents[y]
    
    def size(self, x):
        return -self.parents[self.find(x)]
    
candidate = [-1] * n
f_ship = UnionFind(n)
for _ in range(m):
    a, b = map(int, input().split())
    candidate[a - 1] -= 1
    candidate[b - 1] -= 1
    f_ship.unite(a - 1, b - 1)
for _ in range(k):
    c, d = map(int, input().split())
    if f_ship.is_same(c - 1, d - 1):
        candidate[c - 1] -= 1
        candidate[d - 1] -= 1
for i in range(n):
    candidate[i] += f_ship.size(i)
print(*candidate)

# Fixed version:
# UnionFind: https://note.nkmk.me/python-union-find/
n, m, k = map(int, input().split())
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)]
    
candidate = [-1] * (n + 1)
f_ship = UnionFind(n)
for _ in range(m):
    a, b = map(int, input().split())
    candidate[a] -= 1
    candidate[b] -= 1
    f_ship.unite(a, b)
for _ in range(k):
    c, d = map(int, input().split())
    if f_ship.is_same(c, d):
        candidate[c] -= 1
        candidate[d] -= 1
for i in range(1, n + 1):
    candidate[i] += f_ship.size(i)
print(*candidate[1:])

# Buggy version:
import time



def solve():
    print("a")
    us = [[i] for i in range(0,n+1)]
    for i in range(1, n + 1):
        for fr in fs[i]:
            if not us[i] is us[fr]:
                if len(us[i])>len(us[fr]):
                    us[i].extend(us[fr])
                    for aa in us[fr]:
                        us[aa] = us[i]
                else:
                    us[fr].extend(us[i])
                    for aa in us[i]:
                        us[aa] = us[fr]
    for i in range(1, n + 1):
        frens = len(us[i]) - 1 - len(fs[i])
        for blo in bs[i]:
            if blo in us[i]:
                frens -= 1
        print(frens, end=" ")
    print()
    return


n, m, k = [int(s) for s in input().split(" ")]

fs = [[] for i in range(n + 1)]
bs = [[] for i in range(n + 1)]

for i in range(m):
    a, b = [int(s) for s in input().split(" ")]
    fs[a].append(b)
    fs[b].append(a)
for i in range(k):
    c, d = [int(s) for s in input().split(" ")]
    bs[c].append(d)
    bs[d].append(c)
solve()


# Fixed version:

def solve():
    us = [[i] for i in range(0,n+1)]
    for i in range(1, n + 1):
        for fr in fs[i]:
            if not us[i] is us[fr]:
                if len(us[i])>len(us[fr]):
                    us[i].extend(us[fr])
                    for aa in us[fr]:
                        us[aa] = us[i]
                else:
                    us[fr].extend(us[i])
                    for aa in us[i]:
                        us[aa] = us[fr]
    for i in range(1, n + 1):
        frens = len(us[i]) - 1 - len(fs[i])
        for blo in bs[i]:
            if us[i] is us[blo]:
                frens -= 1
        print(frens, end=" ")
    print()
    return



n, m, k = [int(s) for s in input().split(" ")]

fs = [[] for i in range(n + 1)]
bs = [[] for i in range(n + 1)]
for i in range(m):
    a, b = [int(s) for s in input().split(" ")]
    fs[a].append(b)
    fs[b].append(a)
for i in range(k):
    c, d = [int(s) for s in input().split(" ")]
    bs[c].append(d)
    bs[d].append(c)


solve()

# Buggy version:
import sys
input = sys.stdin.readline
import numpy as np

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)

N, M, K  = (int(i) for i in input().split())

#graph = np.zeros((N+1, N+1))
#graph2 = [[0] * (N+1) for i in range(N+1)]
uf = UnionFind(N)
fblist = [0] * (N+1)

for i in range(M):
    A, B =  (int(i) for i in input().split())
    uf.union(A, B)
    fblist[A] += 1
    fblist[B] += 1
 
for j in range(K):
    A, B =  (int(i) for i in input().split())
    fblist[A] += 1
    fblist[B] += 1

for i in range(1, N+1):
    print(uf.size(i) - fblist[i] - 1, end=" ")

print()


# Fixed version:
import sys
input = sys.stdin.readline

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)

N, M, K  = (int(i) for i in input().split())

#graph = np.zeros((N+1, N+1))
#graph2 = [[0] * (N+1) for i in range(N+1)]
uf = UnionFind(N)
fblist = [0] * (N+1)

for i in range(M):
    A, B =  (int(i) for i in input().split())
    uf.union(A, B)
    fblist[A] += 1
    fblist[B] += 1
 
for j in range(K):
    A, B =  (int(i) for i in input().split())
    if uf.same(A, B):
        fblist[A] += 1
        fblist[B] += 1

for i in range(1, N+1):
    print(uf.size(i) - fblist[i] - 1, end=" ")

print()

# Buggy version:
import sys
sys.getrecursionlimit(10**6)

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

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

# 木の根を求める
def root(x):
    if par[x] == x:
        return x
    else:
        par[x] = root(par[x])
        return par[x]

# xとyが同じ集合に属するか否か
def bool_same(x,y):
    return root(x) == root(y)

# xとyの属する集合を併合
def unite(x,y):
    x = root(x)
    y = root(y)
    if x != y:
        par[x] = y

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

for i in range(M):
    a,b = AB[i]
    unite(a,b)

member = [0 for i in range(N+1)]

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

ans = [member[par[i]]-1 for i in range(N+1)]

for i in range(M):
    a,b = AB[i]
    if bool_same(a,b):
        ans[a] -= 1
        ans[b] -= 1

for i in range(K):
    c,d = CD[i]
    if bool_same(c,d):
        ans[c] -= 1
        ans[d] -= 1

print(*ans[1:])


# Fixed version:
import sys
sys.setrecursionlimit(10**6)

N,M,K = map(int,input().split())
 
par = [i for i in range(N+1)]
 
# 木の根を求める
def root(x):
    if par[x] == x:
        return x
    else:
        par[x] = root(par[x])
        return par[x]
 
# xとyが同じ集合に属するか否か
def bool_same(x,y):
    return root(x) == root(y)
 
# xとyの属する集合を併合
def unite(x,y):
    x = root(x)
    y = root(y)
    if x != y:
        par[x] = y
 
AB = [list(map(int,input().split())) for i in range(M)]
CD = [list(map(int,input().split())) for i in range(K)]
 
for a,b in AB:
    unite(a,b)
 
for i in range(N+1):
    root(i)
 
member = [0 for i in range(N+1)]
 
for p in par:
    member[p] += 1
 
ans = [member[par[i]]-1 for i in range(N+1)]
 
for a,b in AB:
    if bool_same(a,b):
        ans[a] -= 1
        ans[b] -= 1
for c,d in CD:
    if bool_same(c,d):
        ans[c] -= 1
        ans[d] -= 1
print(' '.join(map(str,ans[1:])))

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

    def FindRoot(self,x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.FindRoot(self.parents[x])
            return self.parents[x]
    
    def Union(self,x,y):
        x = self.FindRoot(x)
        y = self.FindRoot(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 isSame(self,x,y):
        return self.FindRoot(x) == self.FindRoot(y)

    def Size(self,x):
        return -self.parents[self.FindRoot(x)]

n,m,k = [int(x) for x in input().split()]
obj = UnionFind(n)
cnt = [0]*(n+1)
for _ in range(m):
    a,b = [int(x) for x in input().split()]
    obj.Union(a,b)
    cnt[a] += 1
    cnt[b] += 1
for _ in range(k):
    c,d = [int(x) for x in input().split()]
    cnt[c] += 1
    cnt[d] += 1
ans = 0
for i in range(1,n+1):
    ans = obj.Size(i)-1-cnt[i]
    print(ans,end=" ")

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

    def FindRoot(self,x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.FindRoot(self.parents[x])
            return self.parents[x]
    
    def Union(self,x,y):
        x = self.FindRoot(x)
        y = self.FindRoot(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 isSame(self,x,y):
        return self.FindRoot(x) == self.FindRoot(y)

    def Size(self,x):
        return -self.parents[self.FindRoot(x)]

n,m,k = [int(x) for x in input().split()]
obj = UnionFind(n)
cnt = [0]*(n+1)
for _ in range(m):
    a,b = [int(x) for x in input().split()]
    obj.Union(a,b)
    cnt[a] += 1
    cnt[b] += 1
for _ in range(k):
    c,d = [int(x) for x in input().split()]
    if obj.isSame(c,d):
        cnt[c] += 1
        cnt[d] += 1
ans = 0
for i in range(1,n+1):
    ans = obj.Size(i)-1-cnt[i]
    print(ans,end=" ")

# Buggy version:
# https://atcoder.jp/contests/abc157/submissions/10475457

import sys
readline = sys.stdin.readine

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

F = [[] for _ in range(N + 1)]
for _ in range(M):
    a, b = map(int, readline().split())
    F[a].append(b)
    F[b].append(a)

B = [[] for _ in range(N + 1)]
for _ in range(K):
    c, d = map(int, readline().split())
    B[c].append(d)
    B[d].append(c)

seen = [-1] * (N + 1)
group = 0


def dfs(graph, s):
    stack = [s]
    seen[s] = group
    n_connection = 1

    while stack:
        u = stack.pop()
        for v in graph[u]:
            if seen[v] == -1:
                n_connection += 1
                seen[v] = group
                stack.append(v)

    return n_connection


union = {}
for i in range(1, N + 1):
    if seen[i] == -1:
        n = dfs(F, i)
        union[group] = n
        group += 1

ans = []
for i in range(1, N + 1):
    tmp = 0
    tmp += union[seen[i]] - 1
    tmp -= len(F[i])
    for j in B[i]:
        if seen[j] == seen[i]:
            tmp -= 1
    ans.append(tmp)

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


# Fixed version:
# https://atcoder.jp/contests/abc157/submissions/10475457

import sys
readline = sys.stdin.readline

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

F = [[] for _ in range(N + 1)]
for _ in range(M):
    a, b = map(int, readline().split())
    F[a].append(b)
    F[b].append(a)

B = [[] for _ in range(N + 1)]
for _ in range(K):
    c, d = map(int, readline().split())
    B[c].append(d)
    B[d].append(c)

seen = [-1] * (N + 1)
group = 0


def dfs(graph, s):
    stack = [s]
    seen[s] = group
    n_connection = 1

    while stack:
        u = stack.pop()
        for v in graph[u]:
            if seen[v] == -1:
                n_connection += 1
                seen[v] = group
                stack.append(v)

    return n_connection


union = {}
for i in range(1, N + 1):
    if seen[i] == -1:
        n = dfs(F, i)
        union[group] = n
        group += 1

ans = []
for i in range(1, N + 1):
    tmp = 0
    tmp += union[seen[i]] - 1
    tmp -= len(F[i])
    for j in B[i]:
        if seen[j] == seen[i]:
            tmp -= 1
    ans.append(tmp)

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

# Buggy version:
n,m,k=map(int,input().split())
w=[i for i in range(n+1)]
s=[1]*(n+1)
g=[list(map(int,input().split()))for i in range(n)]
def root(x):
    if w[x]==x:
        return x
    x=w[x]
    return root(w[x])
def unite(x,y):
    x=root(x)
    y=root(y)
    if x!=y:
        if s[x]<s[y]:
            w[x]=y
            s[y]+=1
        else:
            w[y]=x
            s[x]+=1
for i in range(m):
    a,b=g[i][0],g[i][1]
    unite(a,b)
for i in range(1,n+1):
    w[i]=root(i)
    s[i]=s[w[i]]
for i in range(m):
    s[g[i][0]]-=1
    s[g[i][1]]-=1
for i in range(k):
    a,b=map(int,input().split())
    if w[a]==w[b]:
        s[a]-=1
        s[b]-=1
for i in range(1,n+1):s[i]-=1
print(*s[1:])

# Fixed version:
n,m,k=map(int,input().split())
w=[i for i in range(n+1)]
s=[1]*(n+1)
g=[list(map(int,input().split()))for i in range(m)]
def root(x):
    if w[x]==x:
        return x
    x=w[x]
    return root(w[x])
def unite(x,y):
    x=root(x)
    y=root(y)
    if x!=y:
        if s[x]<s[y]:
            w[x]=y
            s[y]+=s[x]
        else:
            w[y]=x
            s[x]+=s[y]
for i in range(m):
    a,b=g[i][0],g[i][1]
    unite(a,b)
for i in range(1,n+1):
    w[i]=root(i)
    s[i]=s[w[i]]
for i in range(m):
    s[g[i][0]]-=1
    s[g[i][1]]-=1
for i in range(k):
    a,b=map(int,input().split())
    if w[a]==w[b]:
        s[a]-=1
        s[b]-=1
for i in range(1,n+1):s[i]-=1
print(*s[1:])