module S = Set.Make (struct type t = int let compare = compare end) ;;

Scanf.scanf "%d %d %d" (fun n m k ->
    let friend = Array.make n [] in
    let block = Array.make n S.empty in
    for i = 1 to m do
        Scanf.scanf " %d %d" (fun a b ->
            let a = a - 1 in let b = b - 1 in
            friend.(a) <- b :: friend.(a);
            friend.(b) <- a :: friend.(b);
        )
    done;
    for i = 1 to k do
        Scanf.scanf " %d %d" (fun c d ->
            let c = c - 1 in let d = d - 1 in
            block.(c) <- S.add d block.(c);
            block.(d) <- S.add c block.(d);
        )
    done;
    let clust = Array.make n (-1) in
    let cm    = Array.make n [||] in
    let rec loop i cl =
        if i < n then (
            let cl = if clust.(i) <> -1 then cl else (
                let rec collect acc next = function
                    | [] -> if S.is_empty next then acc else (S.iter (fun v -> clust.(v) <- cl) next; collect acc S.empty (S.elements next))
                    | hd :: tl ->
                            let acc = hd :: acc in
                            let next = List.fold_left (fun next v -> if clust.(v) <> -1 then next else S.add v next) next friend.(hd) in
                            collect acc next tl
                in
                let acc = collect [] (S.singleton i) [] in
                cm.(cl) <- Array.of_list acc;
                cl + 1
            )
            in
            let b = Array.fold_left (fun acc v -> if S.mem v block.(i) then acc + 1 else acc) 0 cm.(clust.(i)) in

            (* let c = S.cardinal (S.diff (S.diff cm.(clust.(i)) block.(i)) friend.(i)) in *)
            let c = Array.length cm.(clust.(i)) - List.length (friend.(i)) - b in

            let () = Printf.printf "%d " (c - 1) in
            loop (i + 1) cl
        )
    in
    loop 0 0
)