use std::collections::HashMap;
use std::collections::HashSet;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

const MOD: i64 = 1_000_000_007;

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

impl UnionFind {
    pub fn new(size: usize) -> UnionFind {
        let mut par = vec![0; size];
        for i in 0..size {
            par[i] = i;
        }
        UnionFind {
            size: size,
            par: par,
        }
    }

    // idxが属しているグループを返す
    pub fn root(&mut self, idx: usize) -> usize {
        if self.par[idx] == idx {
            return idx;
        }
        let r = self.par[idx];
        self.par[idx] = self.root(r);
        return self.par[idx];
    }

    // idx1とidx2が同じグループかを返す
    pub fn same(&mut self, idx1: usize, idx2: usize) -> bool {
        let r1 = self.root(idx1);
        let r2 = self.root(idx2);
        return r1 == r2;
    }

    pub fn unite(&mut self, idx1: usize, idx2: usize) {
        let r1 = self.root(idx1);
        let r2 = self.root(idx2);
        if r1 == r2 {
            return;
        } else {
            self.par[r1] = r2;
        }
    }
}

fn main() {
    input! {
        n: usize,
        m: usize,
        k: usize,
        fe: [[usize; 2]; m],
        be: [[usize; 2]; k]
    }

    let mut uf = UnionFind::new(n);
    for x in fe.iter() {
        uf.unite(x[0] - 1, x[1] - 1);
    }

    let mut m = HashMap::new();
    for i in 0..n {
        let c = m.entry(uf.root(i)).or_insert(0);
        *c += 1;
    }

    let mut e: Vec<Vec<usize>> = vec![Vec::new(); n];
    for x in fe.iter() {
        e[x[0] - 1].push(x[1] - 1);
        e[x[1] - 1].push(x[0] - 1);
    }
    for x in be.iter() {
        e[x[0] - 1].push(x[1] - 1);
        e[x[1] - 1].push(x[0] - 1);
    }

    for i in 0..n {
        let mut c = m[&uf.root(i)];
        for x in e[i].iter() {
            if uf.same(i, *x) {
                c -= 1;
            }
        }

        print!("{}", c - 1);
        if i < n - 1 {
            print!(" ");
        }
    }
    println!();
}


Measured memory_bytes: 31128