import scala.io.StdIn._
import scala.collection._

object Main {
  def main(args: Array[String]) {
    val cardNum = readInt()
    val sList, hList, cList, dList = mutable.ArrayBuffer.range(1, 13 + 1)
    val cardListMap = mutable.Map("S" -> sList, "H" -> hList, "C" -> cList, "D" -> dList)

    checkCards(readLine(), cardNum)
    missingCards

    def checkCards(input: String, limit: Int, i: Int = 1): Unit ={
      if(i < limit) {
        val Array(suit, num) = input.split(" ")
        suit match {
          case "S" => deleteFindCard("S", num)
          case "H" => deleteFindCard("H", num)
          case "C" => deleteFindCard("C", num)
          case "D" => deleteFindCard("D", num)
        }
        checkCards(readLine(), limit, i + 1)
      }
    }

    def deleteFindCard(suit: String, n: String): Unit ={
      cardListMap(suit)(n.toInt - 1) = 0
    }

    def missingCards: Unit = {
      val sMissingCards = findMissingCards("S")
      val hMissingCards = findMissingCards("H")
      val cMissingCards = findMissingCards("C")
      val dMissingCards = findMissingCards("D")

      missingCardsPrintln("S", sMissingCards)
      missingCardsPrintln("H", hMissingCards)
      missingCardsPrintln("C", cMissingCards)
      missingCardsPrintln("D", dMissingCards)
    }

    def findMissingCards(suit: String): Seq[Int] = {
      val notFindCards = cardListMap(suit).filter(i => i > 0)
      if(notFindCards.nonEmpty) notFindCards else Seq()
    }

    def missingCardsPrintln(m: String, s: Seq[Int]): Unit = {
      s.foreach(i => println(s"$m $i"))
    }
  }
}