object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val in = List.fill(n, 2)(sc.next())
  val groupedBySuit = in.groupBy(e => e(0))

  // ???????????????'S'???????????????'H'???????????????'C'???????????????'D'
  // ????????????????????????????????????????????????????????????????????§???????????????????????????
  val suit = List("S", "H", "C", "D")
  for (s <- suit) {
    if (groupedBySuit.get(s).get.size == 13) {}
    else {
      val numList = groupedBySuit.get(s).get.map(e => e(1).toInt)
      val shortage = (1 to 13).diff(numList).toList.sorted
      shortage.foreach(e => println(s"${s} ${e}"))
    }
  }
}