module UnionFind : sig
  type t
  val make : int -> t
  val find : t -> int -> int
  val size : t -> int -> int
  val unite : t -> int -> int -> unit
  val is_same : t -> int -> int -> bool
end = struct
  type t = { rank: int array; parent: int array; size: int array }

  let make n = 
    { rank = Array.make n 0; 
      parent = Array.init n (fun i -> i);
      size = Array.make n 1 }

  let rec find uf i = 
    if uf.parent.(i) = i then i
    else begin
      let j = find uf uf.parent.(i) in 
      uf.parent.(i) <- j; j
    end
  
  let size uf i = uf.size.(find uf i)

  let unite uf i j =
    let x = find uf i in
    let y = find uf j in
    if x = y then ()
    else if uf.rank.(x) < uf.rank.(y) then begin
      uf.parent.(x) <- y;
      uf.size.(y) <- uf.size.(y) + uf.size.(x)
    end
    else begin
      uf.parent.(y) <- x;
      uf.size.(x) <- uf.size.(x) + uf.size.(y);
      if uf.rank.(x) = uf.rank.(y) then uf.rank.(x) <- uf.rank.(y) + 1
    end

  let is_same uf i j = find uf i = find uf j
end

let id x = x
let (n, m, k) = Scanf.sscanf (read_line ()) "%d %d %d" @@ fun n m k -> (n, m, k)
let ab = Array.init m @@ fun _ -> Scanf.sscanf (read_line ()) "%d %d" @@ fun a b -> (a, b)
let cd = Array.init k @@ fun _ -> Scanf.sscanf (read_line ()) "%d %d" @@ fun c d -> (c, d)

let friends =
  (fun tbl -> Array.iter (fun (a, b) -> Hashtbl.add tbl a b; Hashtbl.add tbl b a) ab; tbl)
  (Hashtbl.create n)

let blocks =
  (fun tbl -> Array.iter (fun (a, b) -> Hashtbl.add tbl a b; Hashtbl.add tbl b a) cd; tbl)
  (Hashtbl.create n)
  

let uf = UnionFind.make (n + 1)

let () =
  Array.iter (fun (c, d) -> UnionFind.unite uf c d) ab;
  Array.make n 0 
    |> Array.mapi (fun i _ ->
      let size = UnionFind.size uf (i + 1) in
      let f = List.length @@ Hashtbl.find_all friends (i + 1) in
      let b = List.fold_left (fun s j -> s + if UnionFind.is_same uf (i + 1) j then 1 else 0) 0 @@ Hashtbl.find_all blocks (i + 1) in
      string_of_int @@ max 0 (size - f - b - 1)
    ) |> Array.to_list |> String.concat " " |> print_endline