
object Main {
  def main(args: Array[String]): Unit = {
    val n = scala.io.StdIn.readInt()
    val list = (for(i <- 1 to n) yield {
      val Array(a, b, _*) = readLine.split(" ")
      f"$a ${b.toInt}"
    }).toList
    for (mark <- "SHCD"; number <- 1 to 13) {
      if (!list.contains(f"$mark $number")) {
        println(f"$mark $number")
      }
    }
  }
}