from collections import deque





def dfs(start):

    link = {start}

    S = deque()

    # child = deque()

    visited[start] = 1

    S.append(start)

    while len(S) > 0:

        node = S.pop()

        # child.clear()

        for f in friend[node]:

            if visited[f] == 0:

                S.append(f)

                visited[f] = 1

                link.add(f)

    for i in link:

        res[i] = len(link) - len(link & friend[i]) - len(link & block[i]) - 1





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

visited = [0 for _ in range(N + 1)]

res = [0 for _ in range(N + 1)]



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

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



for a, b in Friend:

    friend[a].add(b)

    friend[b].add(a)



for a, b in Block:

    block[a].add(b)

    block[b].add(a)



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

    if visited[i] == 1:

        continue

    dfs(i)



print((*res[1:]))

from collections import deque



def dfs(start):

    S = deque([start])

    link = {start}

    VL[start] = 1

    while S:

        node = S.pop()

        for f in AB[node]:

            if VL[f] == 1:

                continue

            link.add(f)

            S.append(f)

            VL[f] = 1

    for l in link:

        res[l] = len(link) - len(link & AB[l]) - len(link & CD[l]) - 1



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



AB = [set() for _ in range(N)]

for _ in range(M):

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

    a, b = a - 1, b - 1

    AB[a].add(b)

    AB[b].add(a)



CD = [set() for _ in range(N)]

for _ in range(K):

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

    c, d = c - 1, d - 1

    CD[c].add(d)

    CD[d].add(c)



VL = [0] * N

res = [0] * N



for i in range(N):

    if VL[i] == 0:

        dfs(i)



print((*res))

from collections import deque


def dfs(start):
    link = {start}
    S = deque()
    # child = deque()
    visited[start] = 1
    S.append(start)
    while len(S) > 0:
        node = S.pop()
        # child.clear()
        for f in friend[node]:
            if visited[f] == 0:
                S.append(f)
                visited[f] = 1
                link.add(f)
    for i in link:
        res[i] = len(link) - len(link & friend[i]) - len(link & block[i]) - 1


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)]
visited = [0 for _ in range(N + 1)]
res = [0 for _ in range(N + 1)]
friend = [set() for _ in range(N + 1)]
block = [set() for _ in range(N + 1)]
for a, b in Friend:
    friend[a].add(b)
    friend[b].add(a)
for a, b in Block:
    block[a].add(b)
    block[b].add(a)
for i in range(1, N + 1):
    if visited[i] == 1:
        continue
    dfs(i)
print((*res[1:]))

from collections import deque


def dfs(start):
    S = deque([start])
    link = {start}
    VL[start] = 1
    while S:
        node = S.pop()
        for f in AB[node]:
            if VL[f] == 1:
                continue
            link.add(f)
            S.append(f)
            VL[f] = 1
    for l in link:
        res[l] = len(link) - len(link & AB[l]) - len(link & CD[l]) - 1


N, M, K = list(map(int, input().split()))
AB = [set() for _ in range(N)]
for _ in range(M):
    a, b = list(map(int, input().split()))
    a, b = a - 1, b - 1
    AB[a].add(b)
    AB[b].add(a)
CD = [set() for _ in range(N)]
for _ in range(K):
    c, d = list(map(int, input().split()))
    c, d = c - 1, d - 1
    CD[c].add(d)
    CD[d].add(c)
VL = [0] * N
res = [0] * N
for i in range(N):
    if VL[i] == 0:
        dfs(i)
print((*res))

+    S = deque([start]) -    S = deque() -    # child = deque() -    visited[start] = 1 -    S.append(start) -    while len(S) > 0: +    VL[start] = 1 +    while S: -        # child.clear() -        for f in friend[node]: -            if visited[f] == 0: -                S.append(f) -                visited[f] = 1 -                link.add(f) -    for i in link: -        res[i] = len(link) - len(link & friend[i]) - len(link & block[i]) - 1 +        for f in AB[node]: +            if VL[f] == 1: +                continue +            link.add(f) +            S.append(f) +            VL[f] = 1 +    for l in link: +        res[l] = len(link) - len(link & AB[l]) - len(link & CD[l]) - 1 -Friend = [list(map(int, input().split())) for _ in range(M)] -Block = [list(map(int, input().split())) for _ in range(K)] -visited = [0 for _ in range(N + 1)] -res = [0 for _ in range(N + 1)] -friend = [set() for _ in range(N + 1)] -block = [set() for _ in range(N + 1)] -for a, b in Friend: -    friend[a].add(b) -    friend[b].add(a) -for a, b in Block: -    block[a].add(b) -    block[b].add(a) -for i in range(1, N + 1): -    if visited[i] == 1: -        continue -    dfs(i) -print((*res[1:])) +AB = [set() for _ in range(N)] +for _ in range(M): +    a, b = list(map(int, input().split())) +    a, b = a - 1, b - 1 +    AB[a].add(b) +    AB[b].add(a) +CD = [set() for _ in range(N)] +for _ in range(K): +    c, d = list(map(int, input().split())) +    c, d = c - 1, d - 1 +    CD[c].add(d) +    CD[d].add(c) +VL = [0] * N +res = [0] * N +for i in range(N): +    if VL[i] == 0: +        dfs(i) +print((*res))