#include<iostream>//TLE by using bfs with STL
#include<queue>
using namespace std;

struct node
{long long v; struct node *next;};

class Queue{
    private:
    struct node *head, *z;
    public:
    Queue();
    ~Queue();
    inline void put(long long x);
    inline long long get();
    inline long long empty();
};

void visit(queue<long long> queue, long long k, struct node *z, struct node **adj, long long val[], long long component_num[], long long component_size[], long long num){
    long long id = 0;
    struct node *t;
    queue.push(k);
    while(!queue.empty()){
        k = queue.front();
        queue.pop();
        val[k] = ++id;
        component_num[k] = num;
        for(t = adj[k]; t != z; t = t -> next)
        if(val[t -> v] == 0){
            queue.push(t -> v);
            val[t -> v] = -1;
        }
        component_size[num] = id;
    }
}

void search(queue<long long> queue, long long V, struct node *z, struct node **adj, long long val[], long long component_num[], long long component_size[]){
    long long k;
    long long num = 0;
    for(k = 1; k <= V; k++) val[k] = 0;
    for(k = 1; k <= V; k++){
        if(val[k] == 0){
            num++;
            visit(queue, k, z, adj, val, component_num, component_size, num);
        }
    }
}

int main(){
    //nyuryoku
    long long N, M, K;
    cin >> N >> M >> K;
    long long A[M + 1], B[M + 1];
    long long C[K + 1], D[K + 1];
    for(long long i = 1; i <= M; i++){
        cin >> A[i] >> B[i];
    }
    for(long long j = 1; j <= K; j++){
        cin >> C[j] >> D[j];
    }

    //edge_size
    long long friend_size[N + 1];
    long long block_size[N + 1];
    for(long long k = 1; k <= N; k++){
        friend_size[k] = 0;
        block_size[k] = 0;
    }

    //adjacency list representation_friend
    struct node *t;
    struct node *adj_friend[N + 1], *z_friend;
    z_friend = new node;
    z_friend -> next = z_friend;
    for(long long k = 1; k <= N; k++) adj_friend[k] = z_friend;
    for(long long i = 1; i <= M; i++){
        t = new node;
        t -> v = A[i];
        t -> next = adj_friend[B[i]];
        adj_friend[B[i]] = t;
        t = new node;
        t -> v = B[i];
        t -> next = adj_friend[A[i]];
        adj_friend[A[i]] = t;
        // edge
        friend_size[A[i]] += 1;
        friend_size[B[i]] += 1;
    }

    //bfs
    queue<long long> queue_friend;
    long long val_friend[N + 1];
    long long component_num_friend[N + 1];
    long long component_size_friend[N + 1];//index is component_num
    search(queue_friend, N, z_friend, adj_friend, val_friend, component_num_friend, component_size_friend);

    //adjacency list representation_block
    struct node *adj_block[N + 1], *z_block;
    z_block = new node;
    z_block -> next = z_block;
    for(long long k = 1; k <= N; k++) adj_block[k] = z_block;
    for(long long j = 1; j <= K; j++){
        t = new node;
        t -> v = C[j];
        t -> next = adj_block[D[j]];
        adj_block[D[j]] = t;
        t = new node;
        t -> v = D[j];
        t -> next = adj_block[C[j]];
        adj_block[C[j]] = t;
        // edge
        if(component_num_friend[C[j]] == component_num_friend[D[j]]){
            block_size[C[j]] += 1;
            block_size[D[j]] += 1;
        }
    }

    for(long long k = 1; k <= N; k++){
        cout << component_size_friend[component_num_friend[k]] -1 - friend_size[k] - block_size[k] << " ";
    }
    cout << endl;
    system("pause");
    return 0;
}

Measured memory_bytes: 21752