type symbol =
  | Spade
  | Heart
  | Club
  | Diamond

type card = symbol * int

let iota ?(start=0) ?(step=1) count =
  let rec doit count acc =
    if count <= 0 then acc
    else
      let i = count - 1 in
      doit i (start + i * step :: acc)
  in
  doit count []

let split str delim =
  let rec doit s acc =
    match
      try Some (String.index s delim)
      with _ -> None
    with
    | None -> s :: acc
    | Some i ->
        let s1 = String.sub s 0 i in
        let s2 = String.sub s (i + 1) (String.length s - String.length s1 - 1) in
        doit s2 (s1 :: acc)
  in
  List.rev (doit str [])

let read_cards n =
  let rec doit i acc =
    if i > n then acc
    else
      let l = read_line () in
      match split l ' ' with
      | [] | [_] -> exit 1
      | s :: n :: _ ->
          let n = int_of_string n in
          match s with
          | "S" -> doit (i + 1) ((Spade, n) :: acc)
          | "H" -> doit (i + 1) ((Heart, n) :: acc)
          | "C" -> doit (i + 1) ((Club, n) :: acc)
          | "D" -> doit (i + 1) ((Diamond, n) :: acc)
          | _ -> exit 1
  in
  doit 1 []

let print_card sym num =
  match sym with
  | Spade -> Printf.printf "S %d\n" num
  | Heart -> Printf.printf "H %d\n" num
  | Club -> Printf.printf "C %d\n" num
  | Diamond -> Printf.printf "D %d\n" num

let () =
  let n = read_int () in
  let all_sym = [Spade; Heart; Club; Diamond] in
  let all_num = iota 13 ~start:1 in
  let cards = read_cards n in
  List.iter (fun sym ->
    List.iter (fun num ->
      if not (List.mem (sym, num) cards) then print_card sym num
      ) all_num
    ) all_sym