use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

pub fn read_n<T: FromStr>(n: usize) -> Vec<T> {
    read_n_logic::<T>(n, vec![])
}

pub fn read_n_logic<T: FromStr>(n: usize, mut a: Vec<T>) -> Vec<T> {
    match n {
        0 => a,
        _ => {
            a.push(read::<T>());
            read_n_logic(n - 1, a)
        }
    }
}
use std::cmp::{max, min};
use std::collections::HashMap;

struct UnionFind {
    parent: Vec<usize>,
    size: Vec<usize>,
}

impl UnionFind {
    fn new(n: usize) -> UnionFind {
        // initialize
        let mut v: Vec<usize> = vec![];
        for i in 0..n + 1 {
            v.push(i)
        }
        let mut s: Vec<usize> = vec![1; n + 1];

        UnionFind { parent: v, size: s }
    }

    fn root(&self, x: usize) -> usize {
        if self.parent[x] == x {
            return x;
        } else {
            return self.root(self.parent[x]);
        }
    }

    fn size(&self, a: usize) -> usize {
        let ra = self.root(a);
        self.size[ra]
    }

    fn unite(&mut self, a: usize, b: usize) {
        let mut ra = self.root(a);
        let mut rb = self.root(b);
        if ra == rb {
            return;
        }
        if self.size[ra] < self.size[rb] {
            std::mem::swap(&mut ra, &mut rb)
        };
        self.size[ra] += self.size[rb];
        self.parent[rb] = ra;
    }

    fn same(&self, a: usize, b: usize) -> bool {
        let ra = self.root(a);
        let rb = self.root(b);
        ra == rb
    }
}

fn main() {
    let n: usize = read();
    let m: usize = read();
    let k: usize = read();
    let mut map: HashMap<i64, Vec<i64>> = HashMap::new();
    let mut map_anchi: HashMap<i64, Vec<i64>> = HashMap::new();
    let mut uf = UnionFind::new(n);
    for _ in 0..m {
        let a: i64 = read();
        let b: i64 = read();
        uf.unite(a as usize, b as usize);
        hashmap_process(&mut map, a, b);
    }

    for _ in 0..k {
        let a: i64 = read();
        let b: i64 = read();
        hashmap_process(&mut map_anchi, a, b);
    }

    for i in 1..n + 1 {
        let i_i64 = i as i64;
        let mut ans = uf.size(i) - 1;
        ans -= match map.get(&i_i64) {
            None => 0,
            Some(s) => s.len(),
        };
        ans -= match map_anchi.get(&i_i64) {
            None => 0,
            Some(s) => {
                let mut cnt = 0;
                for j in s {
                    if uf.same(i as usize, *j as usize) {
                        cnt += 1
                    }
                }
                cnt
            }
        };
        print!("{} ", ans);
    }
}

fn hashmap_process(map: &mut HashMap<i64, Vec<i64>>, a: i64, b: i64) {
    if map.contains_key(&a) {
        let current = map.get_mut(&a).unwrap();
        current.push(b);
    } else {
        map.insert(a, vec![b]);
    }

    if map.contains_key(&b) {
        let current = map.get_mut(&b).unwrap();
        current.push(a);
    } else {
        map.insert(b, vec![a]);
    }
}


Measured memory_bytes: 26080