
object Main extends App {
  val isExistCard = Array.fill(4,13)(false)
  val suites = Map("S" -> 0, "H" -> 1, "C" -> 2, "D" -> 3)

  val n = readLine().toInt

  for (i <- 0 until n) {
    val Seq(s, strr) = readLine().split(' ').toList
    isExistCard(suites(s))(strr.toInt - 1) = true
  }

  for {
    k <- suites.keysIterator
    m <- 1 to 13
  } if (!isExistCard(suites(k))(m - 1))
    println("%s %d".format(k, m))
}

