// #include <ext/pb_ds/assoc_container.hpp> 
        // #include <ext/pb_ds/tree_policy.hpp> 
        #include <iostream>
        #include <iomanip>
        #include <sstream>
        #include <cstring>
        #include <vector>
        #include <deque>
        #include <queue>
        #include <set>
        #include <map>
        #include <valarray>
        #include <iterator>
        #include <functional>
        #include <limits>
        #include <algorithm>
        #include <numeric>
        #include <cmath>
        #include <cassert>
        #include <unordered_map>
        #include <unordered_set>
        #include <stack>
        using namespace std;
        #define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
        #define trace(x) cerr << #x << ": " << x << " " << endl;
         
        typedef int64_t ll;
         
        #define endl '\n'
        #define int ll
        ll mod=1e18;
        ll mod1=1e9+5;
         
        ll power(ll a,ll b)
        {
            if(b==0) return 1;
            else if(b%2==0)
                return power((((a%mod)*(a%mod))%mod),b/2)%mod;
            else return ((a%mod)*(power((((a%mod)*(a%mod))%mod),b/2)%mod))%mod;
        }
         
        // using namespace __gnu_pbds;
        // #define ordered_set tree<pair<int,int>, null_type,less<pair<int,int>>, rb_tree_tag,tree_order_statistics_node_update>
        //find_by_order(k)  returns iterator to kth element starting from 0;
        //order_of_key(k) returns count of elements strictly smaller than k;
        //erase,insert same as normal set
        int a[100001];
        int sz[100001];
        void init(int n)
        {
            for(int i=1;i<=n;++i)
            {
                a[i]=i;
                sz[i]=1;
            }
        }
       int root(int i)
       {
        while(i!=a[i])
            i=a[i];
        return i;
       }
       void un(int x,int y)
       {
            int p=root(x);
            int q=root(y);
            if(p==q)
                return ;
            if(sz[p]<sz[q])
            {
                a[p]=a[q];
                sz[q]+=sz[p];
            }
            else
            {
                a[q]=a[p];
                sz[p]+=sz[q];
            }
       }
       vector<int> dost[100001];
       vector<int> dusman[100001];
        int32_t main()
        {
            IOS
     

            int n,m,k;
            cin>>n>>m>>k;
            init(n);
            for(int i=1;i<=m;i++)
            {
                int x,y;
                cin>>x>>y;
                un(x,y);
                dost[x].push_back(y);
                dost[y].push_back(x);
            }
            for(int i=1;i<=k;i++)
            {
                int x,y;
                cin>>x>>y;
                dusman[x].push_back(y);
                dusman[y].push_back(x);
            }
            for(int i=1;i<=n;i++)
            {
                int c=sz[root(i)];
                c--;
                int q=root(i);
                for(auto j:dusman[i])
                {
                    if(root(j)==q)
                        c--;
                }
                int p=dost[i].size();
                c-=p;
                cout<<c<<" ";
            }


            
        }       

Measured memory_bytes: 14452