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

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

for _ in range(M):

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

    G[a].append(b)

    G[b].append(a)

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

cnt = 0

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

    if col[i]<0:

        col[i] = cnt

        que = deque([i])

        while que:

            x = que.popleft()

            for y in G[x]:

                if col[y]<0:

                    col[y] = cnt

                    que.append(y)

        cnt += 1

C = {}

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

    c = col[i]

    if c not in C:

        C[c] = 0

    C[c] += 1

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

for _ in range(K):

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

    B[c].append(d)

    B[d].append(c)

A = []

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

    c = col[i]

    cnt = C[c]-len(G[i])-1

    for y in B[i]:

        if col[y]==c:

            cnt -= 1

    A.append(cnt)

print((*A))
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()))
G = {i: [] for i in range(1, N + 1)}
for _ in range(M):
    a, b = list(map(int, input().split()))
    G[a].append(b)
    G[b].append(a)
col = [-1 for _ in range(N + 1)]
cnt = 0
for i in range(1, N + 1):
    if col[i] < 0:
        col[i] = cnt
        que = deque([i])
        while que:
            x = que.popleft()
            for y in G[x]:
                if col[y] < 0:
                    col[y] = cnt
                    que.append(y)
        cnt += 1
C = {}
for i in range(1, N + 1):
    c = col[i]
    if c not in C:
        C[c] = 0
    C[c] += 1
B = {i: [] for i in range(1, N + 1)}
for _ in range(K):
    c, d = list(map(int, input().split()))
    B[c].append(d)
    B[d].append(c)
A = []
for i in range(1, N + 1):
    c = col[i]
    cnt = C[c] - len(G[i]) - 1
    for y in B[i]:
        if col[y] == c:
            cnt -= 1
    A.append(cnt)
print((*A))

-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] - +from collections import deque -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)} +G = {i: [] for i in range(1, N + 1)} -    union(a, b) -    A[a].append(b) -    A[b].append(a) +    G[a].append(b) +    G[b].append(a) +col = [-1 for _ in range(N + 1)] +cnt = 0 +for i in range(1, N + 1): +    if col[i] < 0: +        col[i] = cnt +        que = deque([i]) +        while que: +            x = que.popleft() +            for y in G[x]: +                if col[y] < 0: +                    col[y] = cnt +                    que.append(y) +        cnt += 1 +C = {} +for i in range(1, N + 1): +    c = col[i] +    if c not in C: +        C[c] = 0 +    C[c] += 1 +B = {i: [] for i in range(1, N + 1)} -C = [] +A = [] -    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)) +    c = col[i] +    cnt = C[c] - len(G[i]) - 1 +    for y in B[i]: +        if col[y] == c: +            cnt -= 1 +    A.append(cnt) +print((*A))