object Main extends App {
  val scanner = new java.util.Scanner(System.in)
  val n = scanner.nextInt()

  val having = (1 to n).map { _ =>
    (scanner.next(), scanner.nextInt())
  }

  val cards =
    for {
      suit <- List("S", "H", "C", "D")
      num  <- 1 to 13
    } yield (suit, num)
  
  val outputs = cards.filter(!having.contains(_))
  
  outputs.foreach(t => println(s"${t._1} ${t._2}"))
}