/**
  * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_6_B
  * Array - Finding Missing Cards
  */
object Main {
  def main(args: Array[String]): Unit = {
    val suits = Seq("S", "H", "C", "D")
    val ranks = 1 to 13
    val cards = for (suit <- suits; rank <- ranks) yield Card(suit, rank)
    val n = io.StdIn.readInt()
    val tarosCards = Iterator.continually(io.StdIn.readLine()).takeWhile(_ != null).take(n).map(_.split(" "))
      .map { case Array(s, r) => Card(s, r.toInt) }
      .toSeq
    cards.diff(tarosCards).sorted.foreach {
      case Card(suite, rank) => println(s"$suite $rank")
    }
  }

  case class Card(suite: String, rank: Int) extends Ordered[Card] {
    val suitOrders = Map("S" -> 1, "H" -> 2, "C" -> 3, "D" -> 4)

    def compare(that: Card): Int = {
      import scala.math.Ordered._
      (suitOrders(this.suite), this.rank).compare((suitOrders(that.suite), that.rank))
    }
  }

}