class UnionFind():

    def __init__(self, n):

        self.n = n

        self.root = [-1]*(n+1)

        self.rnk = [0]*(n+1)



    def find_root(self, x):

        if(self.root[x] < 0):

            return x

        else:

            self.root[x] = self.find_root(self.root[x])

            return self.root[x]

    

    def unite(self, x, y):

        x, y = self.find_root(x), self.find_root(y)

        if(x == y):

            return

        elif(self.rnk[x] > self.rnk[y]):

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

            self.root[y] = x

        else:

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

            self.root[x] = y

            if(self.rnk[x] == self.rnk[y]):

                self.rnk[y] += 1

    

    def is_same_group(self, x, y):

        return self.find_root(x) == self.find_root(y)



    def count(self, x):

        return -self.root[self.find_root(x)]

    

    def __str__(self):

        return 'UnionFind(n: {}, root: {}, rnk: {})'.format(self.n, self.root, self.rnk)

    

    def __repr__(self):

        return self.__str__()



inputs = open(0).readlines()

n, m, k = list(map(int, inputs[0].split()))

AB = [tuple(map(int, ab.split())) for ab in inputs[1:m+1]]

CD = [tuple(map(int, cd.split())) for cd in inputs[m+1:]]



uf = UnionFind(n)

friends = [set() for _ in range(n)]

for n0, n1 in AB:

    uf.unite(n0-1, n1-1)

    friends[n0-1].add(n1-1)

    friends[n1-1].add(n0-1)



blocks = [set() for _ in range(n)]

for n0, n1 in CD:

    if uf.is_same_group(n0-1, n1-1):

        blocks[n0-1].add(n1-1)

        blocks[n1-1].add(n0-1)



candidates = []

for i in range(n):

    candidates.append(uf.count(i) - len(friends[i]) - len(blocks[i]) - 1)

print((*candidates))
class UnionFind():

    def __init__(self, n):

        self._n = n

        self._table = [-1]*n



    def _root(self, x):

        stack = []

        while self._table[x] >= 0:

            stack.append(x)

            x = self._table[x]

        for y in stack:

            self._table[y] = x

        return x

    

    def unite(self, x, y):

        x, y = self._root(x), self._root(y)

        if x == y:

            return

        if x > y:

            x, y = y, x

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

        self._table[y] = x

    

    def same(self, x, y):

        return self._root(x) == self._root(y)



    def count_members(self, x):

        return -self._table[self._root(x)]

    

    def count_groups(self):

        return len({self._root(i) for i in range(n)})

    

    def __str__(self):

        return str([self._root(i) for i in range(n)])

    

    def __repr__(self):           

        return repr([self._root(i) for i in range(n)])



n, m, k, *ABCD = list(map(int, open(0).read().split()))

AB = list(zip(ABCD[:2*m][::2], ABCD[:2*m][1::2]))

CD = list(zip(ABCD[2*m:][::2], ABCD[2*m:][1::2]))



uf = UnionFind(n)



friends = [set() for _ in range(n)]

for a, b in AB:

    a, b = a-1, b-1

    uf.unite(a, b)

    friends[a].add(b)

    friends[b].add(a)

    

blocks = [set() for _ in range(n)]

for c, d in CD:

    c, d = c-1, d-1

    if uf.same(c, d):

        blocks[c].add(d)

        blocks[d].add(c)



candidates = []

for i in range(n):

    candidates.append(uf.count_members(i)-len(friends[i])-len(blocks[i])-1)

print((*candidates))
class UnionFind:
    def __init__(self, n):
        self.n = n
        self.root = [-1] * (n + 1)
        self.rnk = [0] * (n + 1)

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

    def unite(self, x, y):
        x, y = self.find_root(x), self.find_root(y)
        if x == y:
            return
        elif self.rnk[x] > self.rnk[y]:
            self.root[x] += self.root[y]
            self.root[y] = x
        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            if self.rnk[x] == self.rnk[y]:
                self.rnk[y] += 1

    def is_same_group(self, x, y):
        return self.find_root(x) == self.find_root(y)

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

    def __str__(self):
        return "UnionFind(n: {}, root: {}, rnk: {})".format(self.n, self.root, self.rnk)

    def __repr__(self):
        return self.__str__()


inputs = open(0).readlines()
n, m, k = list(map(int, inputs[0].split()))
AB = [tuple(map(int, ab.split())) for ab in inputs[1 : m + 1]]
CD = [tuple(map(int, cd.split())) for cd in inputs[m + 1 :]]
uf = UnionFind(n)
friends = [set() for _ in range(n)]
for n0, n1 in AB:
    uf.unite(n0 - 1, n1 - 1)
    friends[n0 - 1].add(n1 - 1)
    friends[n1 - 1].add(n0 - 1)
blocks = [set() for _ in range(n)]
for n0, n1 in CD:
    if uf.is_same_group(n0 - 1, n1 - 1):
        blocks[n0 - 1].add(n1 - 1)
        blocks[n1 - 1].add(n0 - 1)
candidates = []
for i in range(n):
    candidates.append(uf.count(i) - len(friends[i]) - len(blocks[i]) - 1)
print((*candidates))

class UnionFind:
    def __init__(self, n):
        self._n = n
        self._table = [-1] * n

    def _root(self, x):
        stack = []
        while self._table[x] >= 0:
            stack.append(x)
            x = self._table[x]
        for y in stack:
            self._table[y] = x
        return x

    def unite(self, x, y):
        x, y = self._root(x), self._root(y)
        if x == y:
            return
        if x > y:
            x, y = y, x
        self._table[x] += self._table[y]
        self._table[y] = x

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

    def count_members(self, x):
        return -self._table[self._root(x)]

    def count_groups(self):
        return len({self._root(i) for i in range(n)})

    def __str__(self):
        return str([self._root(i) for i in range(n)])

    def __repr__(self):
        return repr([self._root(i) for i in range(n)])


n, m, k, *ABCD = list(map(int, open(0).read().split()))
AB = list(zip(ABCD[: 2 * m][::2], ABCD[: 2 * m][1::2]))
CD = list(zip(ABCD[2 * m :][::2], ABCD[2 * m :][1::2]))
uf = UnionFind(n)
friends = [set() for _ in range(n)]
for a, b in AB:
    a, b = a - 1, b - 1
    uf.unite(a, b)
    friends[a].add(b)
    friends[b].add(a)
blocks = [set() for _ in range(n)]
for c, d in CD:
    c, d = c - 1, d - 1
    if uf.same(c, d):
        blocks[c].add(d)
        blocks[d].add(c)
candidates = []
for i in range(n):
    candidates.append(uf.count_members(i) - len(friends[i]) - len(blocks[i]) - 1)
print((*candidates))

-        self.n = n -        self.root = [-1] * (n + 1) -        self.rnk = [0] * (n + 1) +        self._n = n +        self._table = [-1] * n -    def find_root(self, x): -        if self.root[x] < 0: -            return x -        else: -            self.root[x] = self.find_root(self.root[x]) -            return self.root[x] +    def _root(self, x): +        stack = [] +        while self._table[x] >= 0: +            stack.append(x) +            x = self._table[x] +        for y in stack: +            self._table[y] = x +        return x -        x, y = self.find_root(x), self.find_root(y) +        x, y = self._root(x), self._root(y) -        elif self.rnk[x] > self.rnk[y]: -            self.root[x] += self.root[y] -            self.root[y] = x -        else: -            self.root[y] += self.root[x] -            self.root[x] = y -            if self.rnk[x] == self.rnk[y]: -                self.rnk[y] += 1 +        if x > y: +            x, y = y, x +        self._table[x] += self._table[y] +        self._table[y] = x -    def is_same_group(self, x, y): -        return self.find_root(x) == self.find_root(y) +    def same(self, x, y): +        return self._root(x) == self._root(y) -    def count(self, x): -        return -self.root[self.find_root(x)] +    def count_members(self, x): +        return -self._table[self._root(x)] + +    def count_groups(self): +        return len({self._root(i) for i in range(n)}) -        return "UnionFind(n: {}, root: {}, rnk: {})".format(self.n, self.root, self.rnk) +        return str([self._root(i) for i in range(n)]) -        return self.__str__() +        return repr([self._root(i) for i in range(n)]) -inputs = open(0).readlines() -n, m, k = list(map(int, inputs[0].split())) -AB = [tuple(map(int, ab.split())) for ab in inputs[1 : m + 1]] -CD = [tuple(map(int, cd.split())) for cd in inputs[m + 1 :]] +n, m, k, *ABCD = list(map(int, open(0).read().split())) +AB = list(zip(ABCD[: 2 * m][::2], ABCD[: 2 * m][1::2])) +CD = list(zip(ABCD[2 * m :][::2], ABCD[2 * m :][1::2])) -for n0, n1 in AB: -    uf.unite(n0 - 1, n1 - 1) -    friends[n0 - 1].add(n1 - 1) -    friends[n1 - 1].add(n0 - 1) +for a, b in AB: +    a, b = a - 1, b - 1 +    uf.unite(a, b) +    friends[a].add(b) +    friends[b].add(a) -for n0, n1 in CD: -    if uf.is_same_group(n0 - 1, n1 - 1): -        blocks[n0 - 1].add(n1 - 1) -        blocks[n1 - 1].add(n0 - 1) +for c, d in CD: +    c, d = c - 1, d - 1 +    if uf.same(c, d): +        blocks[c].add(d) +        blocks[d].add(c) -    candidates.append(uf.count(i) - len(friends[i]) - len(blocks[i]) - 1) +    candidates.append(uf.count_members(i) - len(friends[i]) - len(blocks[i]) - 1)