//g++ -Wall -Wextra -pedantic -std=c++17 -O3 -Wshadow -Wformat=2 -Wfloat-equal -Wconversion -Wlogical-op -Wcast-qual -Wcast-align -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC contest.cpp

#include <bits/stdc++.h>

// #define _GLIBCXX_DEBUG 1
// #define _GLIBCXX_DEBUG_PEDANTIC 1
// #define _FORTIFY_SOURCE 2

using namespace std;
#define int long long
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x.size())
#define PI 3.1415926535897932384626433832795
int MOD=1e9+7;
int powmod(int a,int l, int md){a%=md; int res=1;while(l){if(l&1)res=res*a%md;l/=2;a=a*a%md;}return res;}
int binpow(int a,int l){int res=1;while(l){if(l&1)res=res*a;l/=2;a=a*a;}return res;}
int invmod(int a, int md){return powmod(a,md-2,md);}
typedef long long ll; typedef unsigned long long ull; typedef long double ld;
typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<ii> vii;
typedef vector<ll> vl; typedef pair<ll,ll> pll; typedef vector< pair<ll,ll> > vll;
#define pb push_back
int __set(int b, int i) {return b|(1LL<<i);} //set ith bit
int __unset(int b, int i) {return b&(~(1UL<<i));}
int __check(int b, int i) {return b&(1LL<<i);} //returns 0 if ith bit is 0
int mulmod(int a, int b, int md) {return ((a%md)*(b%md))%md;}
int addmod(int a, int b, int md) {return (a+b)%md;}
int submod(int a, int b, int md) {return (((a-b)%md)+md)%md;}
int divmod(int a, int b, int md) {return mulmod(a, powmod(b, md-2, md), md);} //if md is prime;
const ll inf = 0xFFFFFFFFFFFFFFFL; //very large number
priority_queue<int, vector<int>, greater<int> > pq; //for min priority_queue
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
clock_t time_p=clock();
void time()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}

class UnionFind {
	private:
		vi p, rank, setCount;
		int NumSets;
	public:
		UnionFind(int N) {
			NumSets = N;
			rank.assign(N, 0);
			setCount.assign(N, 1);
			p.assign(N, 0); for (int i = 0; i < N; i++) p[i] = i; 
		}
		int findSet(int i) { return (p[i] == i) ? i : (p[i] = findSet(p[i])); }
		bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
		void unionSet(int i, int j) {
			if (!isSameSet(i, j)) {
				int x = findSet(i), y = findSet(j);
				NumSets--;
				if (rank[x] > rank[y]) {
					p[y] = x;
					setCount[x] += setCount[y]; }
				else { 
					p[x] = y;
					setCount[y] += setCount[x];
					if (rank[x] == rank[y]) rank[y]++; }
			} 
		}
		int SizeOfSet(int i) { return setCount[findSet(i)]; }
		int NumDisjointSets(){ return NumSets;} 
};

signed main(void)
{
	IOS;
	int n; cin>>n;
	int m,k; cin>>m>>k;
	vector<vi> g1(n); vector<vi> g2(n);
	UnionFind uf(n);
	for(int i = 0; i < m; i++) {
		int u,v; cin>>u>>v;
		g1[u-1].pb(v-1);
		g1[v-1].pb(u-1);
		uf.unionSet(u-1,v-1);
	}
	for(int i = 0; i < k; i++) {
		int u,v; cin>>u>>	v;
		g2[u-1].pb(v-1);
		g2[v-1].pb(u-1);
	}
	vi ans;
	for(int i = 0; i < n; i++) {
		int cnt=uf.SizeOfSet(i);
		for(int j = 0; j < sz(g2[i]); j++) {
			if(uf.isSameSet(i,g2[i][j]))
				cnt--;
		}
		for(int j = 0; j < sz(g1[i]); j++) {
			if(uf.isSameSet(i,g1[i][j]))
				cnt--;
		}
		ans.pb(cnt-1);
	}
	for(int i: ans)
		cout<<i<<" ";
	cout<<endl;
	time();
	return 0;
}

Measured memory_bytes: 16244