object Main {
  val Suits = Array('S', 'H', 'C', 'D')

  def main(args: Array[String]): Unit = {
    val scanner = new java.util.Scanner(System.in)
    val n = scanner.nextInt()

    val deck = Array.ofDim[Boolean](Suits.length, 13)

    Iterator.from(0, 1)
      .takeWhile(_ < n)
      .map(_ => (scanner.next(), scanner.nextInt() - 1))
      .foreach {
        case ("S", rank) => deck(0)(rank) = true
        case ("H", rank) => deck(1)(rank) = true
        case ("C", rank) => deck(2)(rank) = true
        case ("D", rank) => deck(3)(rank) = true
        case _ =>
      }

    deck
      .zipWithIndex
      .flatMap { case (cards, s) =>
        cards
          .zipWithIndex
          .collect { case (false, i) => i }
          .map(i => s"${Suits(s)} ${i + 1}")(collection.breakOut)
      }
      .foreach(println)
  }
}