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

object Main extends App {

  val n     = readInt()
  val lines = Iterator.fill(n)(readLine())

  val cards = {
    val nums  = 1 to 13
    val cards = ListMap(
      "S" -> mutable.Set(nums: _*),
      "H" -> mutable.Set(nums: _*),
      "C" -> mutable.Set(nums: _*),
      "D" -> mutable.Set(nums: _*)
    )

    for {
      line          <- lines
      Array(suit, x) = line.split(" ")
    } {
      cards(suit) -= x.toInt
    }

    cards
  }

  for {
    (suit, xs) <- cards
    x          <- xs.to[SortedSet]
  } {
    println(s"$suit $x")
  }
}

