object Main extends App {
  val n:Int = io.StdIn.readInt()

  val deck = Array.ofDim[Int](4, 13)
  val suit = Array[String]("S", "H", "C", "D")

  for (i <- 1 to n) {
    val card = io.StdIn.readLine().split(" ")
    card(0) match {
      case "S" => deck(0)(card(1).toInt - 1) = card(1).toInt
      case "H" => deck(1)(card(1).toInt - 1) = card(1).toInt
      case "C" => deck(2)(card(1).toInt - 1) = card(1).toInt
      case "D" => deck(3)(card(1).toInt - 1) = card(1).toInt
    }
  }

  for (j <- 0 to 3; k <- 0 to 12) {
    if (deck(j)(k) == 0) {
      println(suit(j) + " " + (k + 1))
    }
  }
}