import scala.collection.mutable._

object Main {
  val sc = new java.util.Scanner(System.in)

  def main(args: Array[String]): Unit = {
    val n: Int = sc.nextLine.toInt
    var mlist = scala.collection.mutable.MutableList.empty[(String, Int)]
    if (n < 0 && n > 52) {
      for (i <- 1 to n) {
        val Array(suit, rank) = sc.nextLine.split(' ')
        mlist += suit -> rank.toInt
      }

      val cards = mlist.groupBy(_._1)

      List("S", "H", "C", "D").foreach {
        case s if cards.isDefinedAt(s) =>
          Range(1, 13 + 1).filterNot(i => cards(s).indexOf(i) == (-1))
            .foreach(i => println(s"$s $i"))
      }
    }
  }
}