from collections import deque

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

F = {i:set() for i in range(1,N+1)}

B = {i:set() for i in range(1,N+1)}

for _ in range(M):

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

    F[a].add(b)

    F[b].add(a)

for _ in range(K):

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

    B[c].add(d)

    B[d].add(c)

A = []

hist = [-1 for _ in range(N+1)]

cnt = -1

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

    if hist[i]<0:

        cnt += 1

        A1 = set()

        que = deque([i])

        hist[i] = cnt

        A1.add(i)

        while que:

            x = que.popleft()

            for y in F[x]:

                if hist[y]<0:

                    A1.add(y)

                    que.append(y)

                    hist[y]=cnt

        A.append(A1)

C = []

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

    cnt = hist[i]

    a = A[cnt]&B[i]

    C.append(len(A[cnt])-len(F[i])-len(a)-1)

print((*C))  
def find(i):

    x = i

    while x!=G[x][0]:

        x = G[x][0]

    return x

def union(i,j):

    ai = find(i)

    ni = G[ai][1]

    aj = find(j)

    nj = G[aj][1]

    if ai!=aj:

        if ni>=nj:

            G[aj][0] = ai

            if G[aj][1]==G[ai][1]:

                G[ai][1] += 1

            G[ai][2] += G[aj][2]

        else:

            G[ai][0] = aj

            G[aj][2] += G[ai][2]

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

G = {i:[i,0,1] for i in range(1,N+1)}

A = {i:[] for i in range(1,N+1)}

B = {i:[] for i in range(1,N+1)}

for _ in range(M):

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

    union(a,b)

    A[a].append(b)

    A[b].append(a)

for _ in range(K):

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

    B[c].append(d)

    B[d].append(c)

C = []

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

    ai = find(i)

    n = G[ai][2]

    m = len(A[i])

    k = 0

    for j in B[i]:

        if ai==find(j):

            k += 1

    n = n-m-k

    C.append(n-1)

print((*C))
from collections import deque

N, M, K = list(map(int, input().split()))
F = {i: set() for i in range(1, N + 1)}
B = {i: set() for i in range(1, N + 1)}
for _ in range(M):
    a, b = list(map(int, input().split()))
    F[a].add(b)
    F[b].add(a)
for _ in range(K):
    c, d = list(map(int, input().split()))
    B[c].add(d)
    B[d].add(c)
A = []
hist = [-1 for _ in range(N + 1)]
cnt = -1
for i in range(1, N + 1):
    if hist[i] < 0:
        cnt += 1
        A1 = set()
        que = deque([i])
        hist[i] = cnt
        A1.add(i)
        while que:
            x = que.popleft()
            for y in F[x]:
                if hist[y] < 0:
                    A1.add(y)
                    que.append(y)
                    hist[y] = cnt
        A.append(A1)
C = []
for i in range(1, N + 1):
    cnt = hist[i]
    a = A[cnt] & B[i]
    C.append(len(A[cnt]) - len(F[i]) - len(a) - 1)
print((*C))

def find(i):
    x = i
    while x != G[x][0]:
        x = G[x][0]
    return x


def union(i, j):
    ai = find(i)
    ni = G[ai][1]
    aj = find(j)
    nj = G[aj][1]
    if ai != aj:
        if ni >= nj:
            G[aj][0] = ai
            if G[aj][1] == G[ai][1]:
                G[ai][1] += 1
            G[ai][2] += G[aj][2]
        else:
            G[ai][0] = aj
            G[aj][2] += G[ai][2]


N, M, K = list(map(int, input().split()))
G = {i: [i, 0, 1] for i in range(1, N + 1)}
A = {i: [] for i in range(1, N + 1)}
B = {i: [] for i in range(1, N + 1)}
for _ in range(M):
    a, b = list(map(int, input().split()))
    union(a, b)
    A[a].append(b)
    A[b].append(a)
for _ in range(K):
    c, d = list(map(int, input().split()))
    B[c].append(d)
    B[d].append(c)
C = []
for i in range(1, N + 1):
    ai = find(i)
    n = G[ai][2]
    m = len(A[i])
    k = 0
    for j in B[i]:
        if ai == find(j):
            k += 1
    n = n - m - k
    C.append(n - 1)
print((*C))

-from collections import deque +def find(i): +    x = i +    while x != G[x][0]: +        x = G[x][0] +    return x + + +def union(i, j): +    ai = find(i) +    ni = G[ai][1] +    aj = find(j) +    nj = G[aj][1] +    if ai != aj: +        if ni >= nj: +            G[aj][0] = ai +            if G[aj][1] == G[ai][1]: +                G[ai][1] += 1 +            G[ai][2] += G[aj][2] +        else: +            G[ai][0] = aj +            G[aj][2] += G[ai][2] + -F = {i: set() for i in range(1, N + 1)} -B = {i: set() for i in range(1, N + 1)} +G = {i: [i, 0, 1] for i in range(1, N + 1)} +A = {i: [] for i in range(1, N + 1)} +B = {i: [] for i in range(1, N + 1)} -    F[a].add(b) -    F[b].add(a) +    union(a, b) +    A[a].append(b) +    A[b].append(a) -    B[c].add(d) -    B[d].add(c) -A = [] -hist = [-1 for _ in range(N + 1)] -cnt = -1 -for i in range(1, N + 1): -    if hist[i] < 0: -        cnt += 1 -        A1 = set() -        que = deque([i]) -        hist[i] = cnt -        A1.add(i) -        while que: -            x = que.popleft() -            for y in F[x]: -                if hist[y] < 0: -                    A1.add(y) -                    que.append(y) -                    hist[y] = cnt -        A.append(A1) +    B[c].append(d) +    B[d].append(c) -    cnt = hist[i] -    a = A[cnt] & B[i] -    C.append(len(A[cnt]) - len(F[i]) - len(a) - 1) +    ai = find(i) +    n = G[ai][2] +    m = len(A[i]) +    k = 0 +    for j in B[i]: +        if ai == find(j): +            k += 1 +    n = n - m - k +    C.append(n - 1)