import scala.collection.mutable._

object Main {
  def output(kind: String, cards: Map[String, _ <: scala.collection.mutable.Seq[Int]]): Unit = {
    for(i <- (1 to 13) diff cards(kind)) {
      println(s"${kind} ${i}")
    }
  }

  def main(args: Array[String]): Unit = {
    val scanner = new java.util.Scanner(System.in)
    val cards = Map(
      "S" -> ListBuffer[Int](),
      "H" -> ListBuffer[Int](),
      "C" -> ListBuffer[Int](),
      "D" -> ListBuffer[Int]()
    )

    val n = scanner.nextInt
    for(_ <- 1 to n) {
      cards(scanner.next) += scanner.nextInt
    }

    output("S", cards)
    output("H", cards)
    output("C", cards)
    output("D", cards)
  }
}
