object Main {
  def main(args: Array[String]): Unit = {
    val n = readInt
    val list = for(i <- 1 to n) yield {
      val Array(a,b,_*) = readLine.split(" ")
      (a, b.toInt)
    }

    List("S","H","C","D").flatMap { mark => (1 to 13).map{(mark, _)} }
    .filterNot(list.contains).map{ t => println(t._1+" "+t._2) }
  }
}