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
    val suits = List("S", "H", "C", "D")
    val mlist = scala.collection.mutable.MutableList.empty[(String, Int)]
    for (i <- 1 to n) {
      val Array(suit, rank) = sc.nextLine.split(' ')
      mlist += suit -> rank.toInt
    }

    val cards = suits.map(s => s -> Nil).toMap.map {
      case (s, r) =>
        s -> mlist.collect { case c if c._1 == s => c._2 }.toList
    }

    
    suits.foreach {
      case s if cards(s) != Nil =>
        Range(1, 13 + 1).filter(i => cards(s).indexOf(i) != (-1)).foreach(i => println(s"$s $i"))
      case s =>
        Range(1, 13 + 1).foreach(i => println(s"$s $i"))
    }

  }
}