import sys

from collections import deque



input = sys.stdin.readline





def dfs(G, comp_id, comp_cnt):

    i = 0

    cnt = 0

    for v in range(len(G)):

        if comp_id[v] != -1:

            continue

        comp_id[v] = i

        cnt += 1

        stack = deque([v])

        while stack:

            v = stack.pop()

            for c in G[v]:

                if comp_id[c] != -1:

                    continue

                comp_id[c] = i

                cnt += 1

                stack.append(c)

        comp_cnt.append(cnt)

        cnt = 0

        i += 1





def main():

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

    G = [[] for _ in range(N)]

    for _ in range(M):

        A, B = list(map(int, input().split()))

        A -= 1

        B -= 1

        G[A].append(B)

        G[B].append(A)

    B = [[] for _ in range(N)]

    for _ in range(K):

        C, D = list(map(int, input().split()))

        C -= 1

        D -= 1

        B[C].append(D)

        B[D].append(C)



    # connected component

    comp_id = [-1] * N

    comp_cnt = []

    dfs(G, comp_id, comp_cnt)



    ans = [-1] * N

    for i in range(N):

        c_id = comp_id[i]

        n_neighbor = len(G[i])

        n_block = len(B[i])

        for j in B[i]:

            if c_id != comp_id[j]:

                n_block -= 1

        ans[i] = comp_cnt[c_id] - 1 - n_neighbor - n_block

    print((*ans))





if __name__ == "__main__":

    main()

import sys

from collections import deque



input = sys.stdin.readline





def calc_group(N, G, group_id, group_cnt):

    g_id = 0

    for i in range(N):

        if group_id[i] != -1:

            continue

        g_id += 1

        group_id[i] = g_id

        group_cnt[g_id] = 1

        stack = deque([i])

        while stack:

            v = stack.pop()

            for u in G[v]:

                if group_id[u] != -1:

                    continue

                group_id[u] = g_id

                group_cnt[g_id] += 1

                stack.append(u)





def main():

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

    G = [[] for _ in range(N)]

    for _ in range(M):

        A, B = list(map(int, input().split()))

        A -= 1

        B -= 1

        G[A].append(B)

        G[B].append(A)

    B = [[] for _ in range(N)]

    for i in range(K):

        C, D = list(map(int, input().split()))

        C -= 1

        D -= 1

        B[C].append(D)

        B[D].append(C)



    group_id = [-1] * N

    group_cnt = {}

    calc_group(N, G, group_id, group_cnt)



    ans = [0] * N

    for i in range(N):

        n_neighbor = len(G[i])

        n_block = sum(1 for j in B[i] if group_id[i] == group_id[j])

        ans[i] = (group_cnt[group_id[i]] - 1) - n_neighbor - n_block



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





if __name__ == "__main__":

    main()

import sys
from collections import deque

input = sys.stdin.readline


def dfs(G, comp_id, comp_cnt):
    i = 0
    cnt = 0
    for v in range(len(G)):
        if comp_id[v] != -1:
            continue
        comp_id[v] = i
        cnt += 1
        stack = deque([v])
        while stack:
            v = stack.pop()
            for c in G[v]:
                if comp_id[c] != -1:
                    continue
                comp_id[c] = i
                cnt += 1
                stack.append(c)
        comp_cnt.append(cnt)
        cnt = 0
        i += 1


def main():
    N, M, K = list(map(int, input().split()))
    G = [[] for _ in range(N)]
    for _ in range(M):
        A, B = list(map(int, input().split()))
        A -= 1
        B -= 1
        G[A].append(B)
        G[B].append(A)
    B = [[] for _ in range(N)]
    for _ in range(K):
        C, D = list(map(int, input().split()))
        C -= 1
        D -= 1
        B[C].append(D)
        B[D].append(C)
    # connected component
    comp_id = [-1] * N
    comp_cnt = []
    dfs(G, comp_id, comp_cnt)
    ans = [-1] * N
    for i in range(N):
        c_id = comp_id[i]
        n_neighbor = len(G[i])
        n_block = len(B[i])
        for j in B[i]:
            if c_id != comp_id[j]:
                n_block -= 1
        ans[i] = comp_cnt[c_id] - 1 - n_neighbor - n_block
    print((*ans))


if __name__ == "__main__":
    main()

import sys
from collections import deque

input = sys.stdin.readline


def calc_group(N, G, group_id, group_cnt):
    g_id = 0
    for i in range(N):
        if group_id[i] != -1:
            continue
        g_id += 1
        group_id[i] = g_id
        group_cnt[g_id] = 1
        stack = deque([i])
        while stack:
            v = stack.pop()
            for u in G[v]:
                if group_id[u] != -1:
                    continue
                group_id[u] = g_id
                group_cnt[g_id] += 1
                stack.append(u)


def main():
    N, M, K = list(map(int, input().split()))
    G = [[] for _ in range(N)]
    for _ in range(M):
        A, B = list(map(int, input().split()))
        A -= 1
        B -= 1
        G[A].append(B)
        G[B].append(A)
    B = [[] for _ in range(N)]
    for i in range(K):
        C, D = list(map(int, input().split()))
        C -= 1
        D -= 1
        B[C].append(D)
        B[D].append(C)
    group_id = [-1] * N
    group_cnt = {}
    calc_group(N, G, group_id, group_cnt)
    ans = [0] * N
    for i in range(N):
        n_neighbor = len(G[i])
        n_block = sum(1 for j in B[i] if group_id[i] == group_id[j])
        ans[i] = (group_cnt[group_id[i]] - 1) - n_neighbor - n_block
    print((" ".join(map(str, ans))))


if __name__ == "__main__":
    main()

-def dfs(G, comp_id, comp_cnt): -    i = 0 -    cnt = 0 -    for v in range(len(G)): -        if comp_id[v] != -1: +def calc_group(N, G, group_id, group_cnt): +    g_id = 0 +    for i in range(N): +        if group_id[i] != -1: -        comp_id[v] = i -        cnt += 1 -        stack = deque([v]) +        g_id += 1 +        group_id[i] = g_id +        group_cnt[g_id] = 1 +        stack = deque([i]) -            for c in G[v]: -                if comp_id[c] != -1: +            for u in G[v]: +                if group_id[u] != -1: -                comp_id[c] = i -                cnt += 1 -                stack.append(c) -        comp_cnt.append(cnt) -        cnt = 0 -        i += 1 +                group_id[u] = g_id +                group_cnt[g_id] += 1 +                stack.append(u) -    for _ in range(K): +    for i in range(K): -    # connected component -    comp_id = [-1] * N -    comp_cnt = [] -    dfs(G, comp_id, comp_cnt) -    ans = [-1] * N +    group_id = [-1] * N +    group_cnt = {} +    calc_group(N, G, group_id, group_cnt) +    ans = [0] * N -        c_id = comp_id[i] -        n_block = len(B[i]) -        for j in B[i]: -            if c_id != comp_id[j]: -                n_block -= 1 -        ans[i] = comp_cnt[c_id] - 1 - n_neighbor - n_block -    print((*ans)) +        n_block = sum(1 for j in B[i] if group_id[i] == group_id[j]) +        ans[i] = (group_cnt[group_id[i]] - 1) - n_neighbor - n_block +    print((" ".join(map(str, ans))))