import scala.io.Source

object Main extends App {

  val input: List[(String, Int)] = Source.stdin.getLines.toList.tail
                                     .map(_.split(" "))
                                     .map(arr => (arr(0), arr(1).toInt))

  val fullSet: List[(String, Int)] =
    for {
      s <- List("S", "H", "C", "D")
      i <- 1 to 13
    } yield (s, i)

  def missingCards(input: List[(String, Int)]) =
    for {
      card <- fullSet
      if (!input.contains(card))
    } yield card

  missingCards(input).map { case (str, int) => s"$str $int" }.map(println)
}