module app;

import core.bitop;

import std.algorithm;
import std.array;
import std.bigint;
import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.traits;

struct Input
{
	int n, m, k;
	Pair[] friends;
    Pair[] blocks;
}
struct Pair
{
    int p1, p2;
}
struct Person
{
    int suggestions = -1;
    int[] friends;
    int[] blocks;
}

void parseInput(T)(out Input input, T file)
{
	with (file) with (input)
	{
		auto ar = readln().strip().split().map!(to!int).array();
		n = ar[0];
		m = ar[1];
		k = ar[2];
        foreach (i; 0..m)
        {
            ar = readln().strip().split().map!(to!int).array();
            Pair p = {ar[0], ar[1]};
            friends ~= p;
        }
        foreach (i; 0..k)
        {
            ar = readln().strip().split().map!(to!int).array();
            Pair p = {ar[0], ar[1]};
            blocks ~= p;
        }
	}
}

auto main2(Input* input)
{
	with (input)
	{
        Person[] persons;
        persons.length = 100001;
        foreach (friend; friends)
        {
            persons[friend.p1].friends ~= friend.p2;
            persons[friend.p2].friends ~= friend.p1;
        }
        foreach (block; blocks)
        {
            persons[block.p1].blocks ~= block.p2;
            persons[block.p2].blocks ~= block.p1;
        }

        for (int i = 1; i <= n; i++)
        {
            if (persons[i].suggestions != -1)
                continue;

            int[] group;
            void walkGroup(int i)
            {
                auto sortedGroup = assumeSorted(group);
                if (!sortedGroup.contains(i))
                {
                    group ~= i;
                    group.sort();
                }
                else
                    return;
                foreach (friend; persons[i].friends)
                {
                    walkGroup(friend);
                }
            }

            walkGroup(i);

            auto sortedGroup = assumeSorted(group);
            foreach (g; group)
            {
                persons[g].suggestions = cast(int)group.length - 1;//自分を除く
                persons[g].suggestions = persons[g].suggestions - cast(int)persons[g].friends.length;
                foreach (block; persons[g].blocks)
                {
                    if (sortedGroup.contains(block))
                        persons[g].suggestions = persons[g].suggestions - 1;
                }
            }
        }

        for (int i = 1; i <= n; i++)
        {
            writef("%d ", persons[i].suggestions);
        }
	}
}


alias retType = ReturnType!main2;
static if (!is(retType == void))
{
	unittest { writeln("begin unittest"); }
	auto _placeholder_ = ReturnType!main2.init;

	unittest // example1
	{
		string example =
`4 4 1
2 1
1 3
3 2
3 4
4 1`;
		if (example.empty) return;
		Input input = void;
		parseExample(input, example);
		auto result = main2(&input);
		printResult(result);
//		assert(result == _placeholder_);
	}

	unittest // example2
	{
		string example =
``;
		if (example.empty) return;
		Input input = void;
		parseExample(input, example);
		auto result = main2(&input);
		printResult(result);
		assert(result == _placeholder_);
	}

	unittest // example3
	{
		string example =
``;
		if (example.empty) return;
		Input input = void;
		parseExample(input, example);
		auto result = main2(&input);
		printResult(result);
		assert(result == _placeholder_);
	}

	unittest { writeln("end unittest"); }

	void parseExample(out Input input, string example)
	{
		struct Adapter
		{
			string[] _lines;
			this(string input) { _lines = input.splitLines(); }
			string readln() { auto line = _lines[0]; _lines = _lines[1..$]; return line; }
		}
		parseInput(input, Adapter(example));
	}
}

void printResult(T)(T result)
{
	static if (isFloatingPoint!T) writefln("%f", result);
	else writeln(result);
}

void main()
{
	Input input = void;
	parseInput(input, stdin);
	alias retType = ReturnType!main2;
	static if (is(retType == void))
		main2(&input);
	else
	{
		auto result = main2(&input);
		printResult(result);
	}
}
