import scala.collection.mutable.{Set => MSet}

object SetTest {
/** @see  m
  *
  * */
  val sc = new java.util.Scanner(System.in)

  def cards: Set[String] ={
    val m: MSet[String] = MSet.empty[String]
    val f = List ("S", "H", "C", "D")
    for (i<- f; j <- 1 to 13) m.add (s"$i $j")
    m.toSet
  }

  def run() = {
    val m0 = cards
    val f = List ("S", "H", "C", "D")
    val n = sc.nextInt // ???????????°??????????????????
    val m1 = Array.fill(n+1)(sc.nextLine).toSet[String]
    val check = m1.exists(n => n == "S 13")
    println("m1 = " + m1)

    val m3 = m0 diff m1
    val a = new Array[List[String]](4)
    for ( i<- 0 until 4) a(i) = m3.filter(p => p.startsWith(f(i))).toList.sortWith((a,b) => a.split(" ")(1).toInt < b.split(" ")(1).toInt)

    for ( i<- a; j <- i) println(j)
  }

}
object Main {
  def main(args: Array[String]): Unit = {

    SetTest.run
  }
}