#[allow(unused_macros)]
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)*}
    };
}

#[allow(unused_macros)]
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)*}
    };
}

#[allow(unused_macros)]
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, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

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

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}
//usage
//input! {
//  h: i32;
//  v: [i32; n]
//  x: [[i32; n]; m]
//  f: chars <- Vec<char>
//}
pub mod at {
    pub struct UnionFind {
        parents: Vec<isize>,
    }
    use std::collections::HashMap;
    impl UnionFind {
        pub fn new(n: usize) -> UnionFind {
            let parents = vec![-1; n];
            UnionFind { parents: parents }
        }
        pub fn find(&mut self, x: usize) -> usize {
            if self.parents[x] < 0 {
                x
            } else {
                let xx = self.parents[x] as usize;
                let y = self.find(xx);
                self.parents[x] = y as isize;
                y
            }
        }
        pub fn unite(&mut self, x: usize, y: usize) -> bool {
            use std::mem::swap;
            let mut x = self.find(x);
            let mut y = self.find(y);
            if x == y {
                return false;
            }
            if self.parents[x] > self.parents[y] {
                swap(&mut x, &mut y);
            }
            self.parents[x] += self.parents[y];
            self.parents[y] = x as isize;
            true
        }
        pub fn size(&mut self, x: usize) -> usize {
            let x = self.find(x);
            (-self.parents[x]) as usize
        }
        pub fn same(&mut self, x: usize, y: usize) -> bool {
            self.find(x) == self.find(y)
        }
        pub fn members(&mut self, x: usize) -> Vec<usize> {
            let root = self.find(x);
            (0..self.parents.len())
                .into_iter()
                .filter(|i| self.find(*i) == root)
                .collect::<Vec<usize>>()
        }
        pub fn roots(&mut self) -> Vec<usize> {
            (0..self.parents.len())
                .into_iter()
                .filter(|i| self.parents[*i] < 0)
                .collect::<Vec<usize>>()
        }
        pub fn all_group_members(&mut self) -> HashMap<usize, Vec<usize>> {
            let mut groups_map = HashMap::new();
            for x in 0..self.parents.len() {
                let r = self.find(x);
                groups_map.entry(r).or_insert(vec![]).push(x);
            }
            groups_map
        }
    }
}

use at::*;

fn main() {
    input! {
        n: usize,
        m: usize,
        k: usize,
        friend: [(usize, usize); m],
        block: [(usize, usize); k],
    }

    let mut b:Vec<Vec<usize>> = vec![vec![]; n + 1];
    let mut f:Vec<Vec<usize>> = vec![vec![]; n + 1];


    for &(x, y) in &friend {
        f[x].push(y);
        f[y].push(x);
    }

    for &(x, y) in &block {
        b[x].push(y);
        b[y].push(x);
    }

    let mut union = UnionFind::new((n + 1) as usize);
    for &(x, y) in &friend {
        union.unite(x, y);
    }

    for i in 1..(n + 1) {
        let mut ans = union.size(i) - f[i].len() - 1;
        for &j in &b[i] {
            if union.same(i, j) {
                ans -= 1;
            }
        }
        println!("{}", ans);
    }
}

Measured memory_bytes: 23292