import scala.io.StdIn.{readInt,readLine}

object Main {

  def main(args: Array[String]) = {
    val n = readInt
    val read:Map[String,Int] = (1 to n).map(_=> readLine.trim -> 1).toMap

    for(x <- List("S","H","C","D"); y<-1 to 13) {
      if(!read.contains(x+" "+y))
        println(x+" "+y)
    }
  }
}