CodeEff/ECCO huggingface dataset:
# Original solution
N, M, K=list(map(int, input().split()))

class UnionFindTree:
    def __init__(self, n):
        self.parent = [-1 for _ in range(n)]

    def root(self, x):
        p, seq = self.parent[x], list()
        while p >= 0:
            seq.append(x)
            x, p = p, self.parent[p]
        for c in seq: self.parent[c] = x
        return x

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

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

    def unite(self, x, y):
        if self.count(x) < self.count(y): x, y = y, x
        xr, yr = self.root(x), self.root(y)
        if xr == yr: return
        self.parent[xr] += self.parent[yr]
        self.parent[yr] = xr

friend_or_block = [0 for _ in range(N)]
friends_chain = UnionFindTree(N)

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

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

print((' '.join(map(str, [friends_chain.count(i) - friend_or_block[i] - 1 for i in range(N)]))))


# Optimized solution
def main():
    N, M, K=list(map(int, input().split()))
    friend_or_block = [0 for _ in range(N)]
    friends_chain = UnionFindTree(N)

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

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

    print((' '.join(map(str, [friends_chain.count(i) - friend_or_block[i] - 1 for i in range(N)]))))

class UnionFindTree:
    def __init__(self, n):
        self.parent = [-1 for _ in range(n)]

    def root(self, x):
        p, seq = self.parent[x], list()
        while p >= 0:
            seq.append(x)
            x, p = p, self.parent[p]
        for c in seq: self.parent[c] = x
        return x

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

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

    def unite(self, x, y):
        if self.count(x) < self.count(y): x, y = y, x
        xr, yr = self.root(x), self.root(y)
        if xr == yr: return
        self.parent[xr] += self.parent[yr]
        self.parent[yr] = xr

if __name__ == '__main__':
    main()
# Original solution
def main():
    N, M, K=list(map(int, input().split()))
    friend_or_block = [0 for _ in range(N)]
    friends_chain = UnionFindTree(N)

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

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

    print((' '.join(map(str, [friends_chain.count(i) - friend_or_block[i] - 1 for i in range(N)]))))

class UnionFindTree:
    def __init__(self, n):
        self.parent = [-1 for _ in range(n)]

    def root(self, x):
        p, seq = self.parent[x], list()
        while p >= 0:
            seq.append(x)
            x, p = p, self.parent[p]
        for c in seq: self.parent[c] = x
        return x

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

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

    def unite(self, x, y):
        xr, yr = self.root(x), self.root(y)
        if xr == yr: return
        if self.parent[xr] > self.parent[yr]: xr, yr = yr, xr
        self.parent[xr] += self.parent[yr]
        self.parent[yr] = xr

if __name__ == '__main__':
    main()



# Optimized solution
def main():
    N, M, K=list(map(int, input().split()))
    friend_or_block = [0] * N
    friends_chain = UnionFindTree(N)

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

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

    ans = [None] * N
    for i in range(N): ans[i] = str(friends_chain.count(i) - friend_or_block[i] - 1)
    print((' '.join(map(str, ans))))

class UnionFindTree:
    def __init__(self, n):
        self.parent = [-1 for _ in range(n)]

    def root(self, x):
        p, seq = self.parent[x], list()
        while p >= 0:
            seq.append(x)
            x, p = p, self.parent[p]
        for c in seq: self.parent[c] = x
        return x

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

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

    def unite(self, x, y):
        xr, yr = self.root(x), self.root(y)
        if xr == yr: return
        if self.parent[xr] > self.parent[yr]: xr, yr = yr, xr
        self.parent[xr] += self.parent[yr]
        self.parent[yr] = xr

if __name__ == '__main__':
    main()
# Original solution
import collections

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

friendships = [list(map(int, input().split(' '))) for _ in range(m)]
disses = [list(map(int, input().split(' '))) for _ in range(k)]

parent = {i:i for i in range(0, n+1)}
sizes = {i:1 for i in range(0, n+1)}

hd = collections.Counter()

adj = collections.defaultdict(set)

def f(parent, u):
	if parent[u] != u: 
		parent[u] = f(parent, parent[u])
	return parent[u]

for a,b in friendships:

	pa,pb = f(parent, a), f(parent, b)
	
	adj[a].add(b)
	adj[b].add(a)

	if pa != pb:
		if sizes[pa] >= sizes[pb]:
			parent[pb] = pa
			sizes[pa] += sizes[pb]
		else:
			parent[pa] = pb
			sizes[pb] += sizes[pa]

for c,d in disses:
	pc,pd = f(parent, c), f(parent, d)
	if d not in adj[c] and (pc == pd):
		hd[c] += 1
		hd[d] += 1

print(' '.join([str(sizes[f(parent,u)] - len(adj[u]) - hd[u] - 1)  for u in range(1, n+1)]))

# Optimized solution
import collections

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

friendships = [list(map(int, input().split(' '))) for _ in range(m)]
disses = [list(map(int, input().split(' '))) for _ in range(k)]

parent = [i for i in range(0, n+1)]
sizes = [1 for i in range(0, n+1)]

hd = collections.Counter()
adj = collections.defaultdict(set)

def f(parent, u):
	if parent[u] != u: 
		parent[u] = f(parent, parent[u])
	return parent[u]

for a,b in friendships:

	pa,pb = f(parent, a), f(parent, b)
	
	adj[a].add(b)
	adj[b].add(a)

	if pa != pb:
		if sizes[pa] >= sizes[pb]:
			parent[pb] = pa
			sizes[pa] += sizes[pb]
		else:
			parent[pa] = pb
			sizes[pb] += sizes[pa]

for c,d in disses:
	pc,pd = f(parent, c), f(parent, d)
	if d not in adj[c] and (pc == pd):
		hd[c] += 1
		hd[d] += 1

print(' '.join([str(sizes[f(parent,u)] - len(adj[u]) - hd[u] - 1)  for u in range(1, n+1)]))
# Original solution
import collections

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

friendships = [list(map(int, input().split(' '))) for _ in range(m)]
disses = [list(map(int, input().split(' '))) for _ in range(k)]

parent = [i for i in range(0, n+1)]
sizes = [1 for i in range(0, n+1)]
hd = [1 for i in range(0, n + 1)]


def f(parent, u):
	if parent[u] != u:  parent[u] = f(parent, parent[u])
	return parent[u]

for a,b in friendships:

	pa,pb = f(parent, a), f(parent, b)
	hd[a] +=1
	hd[b] +=1

	if pa != pb:
		if sizes[pa] >= sizes[pb]:
			parent[pb] = pa
			sizes[pa] += sizes[pb]
		else:
			parent[pa] = pb
			sizes[pb] += sizes[pa]

for c,d in disses:
	pc,pd = f(parent, c), f(parent, d)
	if (pc == pd):
		hd[c] += 1
		hd[d] += 1

print(' '.join([str(sizes[f(parent,u)] - hd[u])  for u in range(1, n+1)]))

# Optimized solution
import collections

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


parent = list(range(0, n+1))
sizes = [1] * (n + 1)
hd = [1] * (n + 1) 

def f(parent, u):
	if parent[u] != u:  parent[u] = f(parent, parent[u])
	return parent[u]

for a,b in [list(map(int, input().split(' '))) for _ in range(m)]:

	pa,pb = f(parent, a), f(parent, b)
	hd[a] +=1
	hd[b] +=1

	if pa != pb:
		if sizes[pa] >= sizes[pb]:
			parent[pb] = pa
			sizes[pa] += sizes[pb]
		else:
			parent[pa] = pb
			sizes[pb] += sizes[pa]

for c,d in [list(map(int, input().split(' '))) for _ in range(k)]:
	pc,pd = f(parent, c), f(parent, d)
	if (pc == pd):
		hd[c] += 1
		hd[d] += 1

print(' '.join([str(sizes[f(parent,u)] - hd[u])  for u in range(1, n+1)]))
# Original solution
import collections
import sys
n,m,k = list(map(int,sys.stdin.readline().split()))
parent = list(range(0, n+1))
sizes = [1] * (n + 1)
hd = [1] * (n + 1) 

def f(parent, u):
	if parent[u] != u:  parent[u] = f(parent, parent[u])
	return parent[u]

for a,b in [list(map(int,sys.stdin.readline().split())) for _ in range(m)]:

	pa,pb = f(parent, a), f(parent, b)
	hd[a] +=1
	hd[b] +=1

	if pa != pb:
		if sizes[pa] <= sizes[pb]: pa,pb = pb,pa
		parent[pb] = pa
		sizes[pa] += sizes[pb]
		

for c,d in [list(map(int,sys.stdin.readline().split())) for _ in range(k)]:
	pc,pd = f(parent, c), f(parent, d)
	if (pc == pd):
		hd[c] += 1
		hd[d] += 1

print(' '.join([str(sizes[f(parent,u)] - hd[u])  for u in range(1, n+1)]))

# Optimized solution
import collections
import sys
n,m,k = list(map(int,sys.stdin.readline().split()))
parent = list(range(0, n+1))
sizes = [1] * (n + 1)
hd = [1] * (n + 1) 

def f(parent, u):
	if parent[u] != u:  parent[u] = f(parent, parent[u])
	return parent[u]

for _ in range(m):
	a,b = list(map(int,sys.stdin.readline().split()))
	pa,pb = f(parent, a), f(parent, b)
	hd[a] +=1
	hd[b] +=1

	if pa != pb:
		if sizes[pa] <= sizes[pb]: pa,pb = pb,pa
		parent[pb] = pa
		sizes[pa] += sizes[pb]
		
for _ in range(k):
	c,d = list(map(int,sys.stdin.readline().split()))
	pc,pd = f(parent, c), f(parent, d)
	if (pc == pd):
		hd[c] += 1
		hd[d] += 1

print(' '.join([str(sizes[f(parent,u)] - hd[u])  for u in range(1, n+1)]))
# Original solution
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

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

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

        if x == y:
            return

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

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

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

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

relations = [[0 for j in range(N)] for i in range(N)]

tree = UnionFind(N)

for i in range(M):
    a, b = list(map(int, input().split()))
    relations[a-1][b-1] = 1
    relations[b-1][a-1] = 1
    tree.union(a-1, b-1)

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

cnt = []

for i in range(N):
    cnt.append(0)
    for j in range(N):
        if i == j:
            continue
        if tree.same(i, j) and relations[i][j] == 0:
            cnt[-1] += 1

print((' '.join(list(map(str, cnt)))))

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

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

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

        if x == y:
            return

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

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

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

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

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

tree = UnionFind(N)
friends = [set() for i in range(N)]
blocks = [set() for i in range(N)]

for i in range(M):
    a, b = list(map(int, input().split()))
    friends[a-1].add(b-1)
    friends[b-1].add(a-1)
    tree.union(a-1, b-1)

for i in range(K):
    c, d = list(map(int, input().split()))
    blocks[c-1].add(d-1)
    blocks[d-1].add(c-1)

cnt = []

for i in range(N):
    group_size = tree.size(i)
    friend_cnt = len(friends[i])
    block_cnt = len([j for j in blocks[i] if tree.same(i, j)])
    cnt.append(group_size - friend_cnt - block_cnt - 1)

print((' '.join(list(map(str, cnt)))))
# Original solution
n,m,k=map(int,input().split())
par=[-1]*n

# this par & rank are initialized lists
def find(x):
    global par
    if par[x]<0:
        return x
    else:
        par[x]=find(par[x])
        return par[x]
        
def unite(x,y):
    x,y=find(x),find(y)
    global par
    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 size(x):
    return -par[find(x)]
def same(x,y):
    return find(x)==find(y)
from sys import stdin 
input=stdin.readline
friend=[set() for i in range(n)]
for i in range(m):
    a,s=map(int,input().split())
    a-=1;s-=1
    unite(a,s)
    friend[a].add(s)
    friend[s].add(a)
anti=[set() for i in range(n)]
for i in range(k):
    a,b=map(int,input().split())
    a-=1;b-=1
    anti[a].add(b)
    anti[b].add(a)
friends=[set() for i in range(n)]
for i in range(n):
    friends[find(i)].add(i)

print(*[len(friends[find(i)]-(anti[i]|friend[i]|{i})) for i in range(n)],sep=" ")


# Optimized solution
n,m,k=map(int,input().split())
par=[-1]*n

# this par & rank are initialized lists
def find(x):
    global par
    if par[x]<0:
        return x
    else:
        par[x]=find(par[x])
        return par[x]
        
def unite(x,y):
    x,y=find(x),find(y)
    global par
    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 size(x):
    return -par[find(x)]
def same(x,y):
    return find(x)==find(y)
from sys import stdin 
input=stdin.readline
friend=[0]*n
for i in range(m):
    a,s=map(int,input().split())
    a-=1;s-=1
    unite(a,s)
    friend[a]+=1
    friend[s]+=1
anti=[set() for i in range(n)]
for i in range(k):
    a,b=map(int,input().split())
    a-=1;b-=1
    anti[a].add(b)
    anti[b].add(a)

print(*[size(i)-1-sum(same(i,b) for b in anti[i])-friend[i] for i in range(n)],sep=" ")
# Original solution
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

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

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

        if x == y:
            return

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

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

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

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

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
"""
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

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

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

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
"""
N,M,K = list(map(int,input().split()))
F = UnionFind(N)
B = [set() for _ in range(N)]
FF = [0]*N
for _ in range(M):
    a,b = list(map(int,input().split()))
    F.union(a-1,b-1)
    FF[a-1] += 1
    FF[b-1] += 1
# print(F)
for j in range(K):
    a,b = list(map(int,input().split()))
    B[a-1].add(b-1)
    B[b-1].add(a-1)

Y = []
for i in range(N):
    y = F.size(i) - FF[i] -1
    for b in B[i]:
        if b in F.members(i):
            y += -1
    Y.append(str(y))
print((" ".join(Y)))


# Optimized solution
def find(x):
    if par[x]<0:
        return x
    else:
        par[x]=find(par[x])
        return par[x]
 
def unite(x,y):
  x,y=find(x),find(y)
  if x!=y:
    if x>y:
        x,y=y,x
    par[x]+=par[y]
    par[y]=x
    
def same(x,y):
  return find(x)==find(y)
 
def size(x):
  return-par[find(x)]
 
N,M,K = list(map(int,input().split()))
par=[-1]*N
B = [set() for _ in range(N)]
FF = [0]*N
for _ in range(M):
    a,b = list(map(int,input().split()))
    unite(a-1,b-1)
    FF[a-1] += 1
    FF[b-1] += 1
# print(F)
for j in range(K):
    a,b = list(map(int,input().split()))
    B[a-1].add(b-1)
    B[b-1].add(a-1)

Y = []
for i in range(N):
    y = size(i) - FF[i] -1
    for b in B[i]:
        if same(i,b):
            y += -1
    Y.append(str(y))
print((" ".join(Y)))
# Original solution
import sys
input = sys.stdin.buffer.readline

class UnionFind:
    __slots__ = ["data"]
    
    def __init__(self, n=0):
        self.data = [-1]*(n+1)
    
    def root(self, x):
        if self.data[x] < 0:
            return x
        self.data[x] = self.root(self.data[x])
        return self.data[x]
    
    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if x != y:
            if self.data[x] < self.data[y]:
                self.data[x] += self.data[y]
                self.data[y] = x
            else:
                self.data[y] += self.data[x]
                self.data[x] = y
    
    def same(self, x, y):
        return self.root(x) == self.root(y)
    
    def size(self, x):
        return -self.data[self.root(x)]
                


def main():
    n, m, k = list(map(int, input().split()))
    friends = [0]*(n+1)
    blocks = [0]*(n+1)
    uf = UnionFind(n)
    ans = []
    for _ in range(m):
        a, b = list(map(int, input().split()))
        friends[a] += 1
        friends[b] += 1
        uf.unite(a, b)
    for _ in range(k):
        c, d = list(map(int, input().split()))
        if uf.same(c, d):
            blocks[c] += 1
            blocks[d] += 1
    for i, (nf, nb) in enumerate(zip(friends[1:], blocks[1:]), 1):
        ans.append(uf.size(i)-1-nf-nb)
    print((" ".join(list(map(str, ans)))))


if __name__ == "__main__":
    main()

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

class UnionFind:
    __slots__ = ["data"]
    
    def __init__(self, n=0):
        self.data = [-1]*(n+1)
    
    def root(self, x):
        if self.data[x] < 0:
            return x
        self.data[x] = self.root(self.data[x])
        return self.data[x]
    
    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if x != y:
            if self.data[x] < self.data[y]:
                self.data[x] += self.data[y]
                self.data[y] = x
            else:
                self.data[y] += self.data[x]
                self.data[x] = y
    
    def same(self, x, y):
        return self.root(x) == self.root(y)
    
    def size(self, x):
        return -self.data[self.root(x)]
                


def main():
    n, m, k = list(map(int, input().split()))
    fb = [0]*(n+1)
    uf = UnionFind(n)
    ans = []
    for _ in range(m):
        a, b = list(map(int, input().split()))
        fb[a] += 1
        fb[b] += 1
        uf.unite(a, b)
    for _ in range(k):
        c, d = list(map(int, input().split()))
        if uf.same(c, d):
            fb[c] += 1
            fb[d] += 1
    for i, nfb in enumerate(fb[1:], 1):
        ans.append(uf.size(i)-1-nfb)
    print((" ".join(list(map(str, ans)))))


if __name__ == "__main__":
    main()
# Original solution
import sys
input = sys.stdin.buffer.readline

class UnionFind:
    __slots__ = ["data"]
    
    def __init__(self, n=0):
        self.data = [-1]*(n+1)
    
    def root(self, x):
        if self.data[x] < 0:
            return x
        self.data[x] = self.root(self.data[x])
        return self.data[x]
    
    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if x != y:
            if self.data[x] < self.data[y]:
                self.data[x] += self.data[y]
                self.data[y] = x
            else:
                self.data[y] += self.data[x]
                self.data[x] = y
    
    def same(self, x, y):
        return self.root(x) == self.root(y)
    
    def size(self, x):
        return -self.data[self.root(x)]
                


def main():
    n, m, k = list(map(int, input().split()))
    fb = [0]*(n+1)
    uf = UnionFind(n)
    for _ in range(m):
        a, b = list(map(int, input().split()))
        fb[a] += 1
        fb[b] += 1
        uf.unite(a, b)
    for _ in range(k):
        c, d = list(map(int, input().split()))
        if uf.same(c, d):
            fb[c] += 1
            fb[d] += 1
    ans = [uf.size(i)-1-nfb for i, nfb in enumerate(fb[1:], 1)]
    print((" ".join(list(map(str, ans)))))


if __name__ == "__main__":
    main()

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

class UnionFind:
    __slots__ = ["data"]
    
    def __init__(self, n=0):
        self.data = [-1]*(n+1)
    
    def root(self, x):
        if self.data[x] < 0:
            return x
        self.data[x] = self.root(self.data[x])
        return self.data[x]
    
    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if x != y:
            if self.data[x] < self.data[y]:
                self.data[x] += self.data[y]
                self.data[y] = x
            else:
                self.data[y] += self.data[x]
                self.data[x] = y
    
    def same(self, x, y):
        return self.root(x) == self.root(y)
    
    def size(self, x):
        return -self.data[self.root(x)]
                


def main():
    n, m, k = list(map(int, input().split()))
    fb = [0]*(n+1)
    uf = UnionFind(n)
    for _ in range(m):
        a, b = list(map(int, input().split()))
        fb[a] += 1
        fb[b] += 1
        uf.unite(a, b)
    for _ in range(k):
        c, d = list(map(int, input().split()))
        if uf.same(c, d):
            fb[c] += 1
            fb[d] += 1
    ans = [uf.size(i)-1-fb[i] for i in range(1, n+1)]
    print((" ".join(list(map(str, ans)))))


if __name__ == "__main__":
    main()