import scala.collection.immutable.ListMap
import scala.collection.mutable
import scala.io.StdIn.{readInt, readLine}

object Main extends App {
  val nums = 1 to 13
  val cards = ListMap(
    "S" -> nums.to[mutable.Set],
    "H" -> nums.to[mutable.Set],
    "C" -> nums.to[mutable.Set],
    "D" -> nums.to[mutable.Set]
  )

  val n = readInt()

  for (_ <- 1 to n) {
    val Array(suit, x) = readLine.split(" ")
    cards(suit) -= x.toInt
  }

  for ((s, xs) <- cards; x <- xs.toList.sorted) {
    println(s"$s $x")
  }

}

