let range start stop =
  let rec loop n acc =
    if n >= start then
      loop (n-1) (n :: acc)
    else
      acc
  in
  loop stop []

let make_full () =
  let suits, nums = range 0 3, range 1 13 in
  List.concat (List.map (fun s -> List.map (fun n -> (s, n)) nums) suits)

let find_all_lose hand full =
  List.filter (fun c -> not (List.mem c hand)) full

let to_str (s, n) = (String.sub "SHCD" s 1) ^ " " ^ (string_of_int n)

let to_tup s =
  Str.split (Str.regexp " ") s |>
  (function | [s; n] -> (String.index "SHCD" s.[0], int_of_string n)
            | _ -> failwith "invalid input")

let rec input_loop () =
  let rec loop n acc = match n with
    | 0 -> acc
    | n -> loop (n-1) ((read_line ()) :: acc)
  in
  let num = int_of_string (read_line ()) in
  loop num []

let () =
  let hand = List.map to_tup (input_loop ()) in
  List.iter print_endline (make_full () |>
                           find_all_lose hand |>
                           List.sort compare |>
                           List.map to_str)