fun main(arg: Array<String>) {
    val n = readLine()!!.toInt()
    val list: MutableList<Pair<String, Int>> = mutableListOf()
    for (i in 0..n-1) {
        val (a, b) = readLine()!!.split(" ")
        list.add(Pair(a, b.toInt()))
    }
    for (mark in listOf("S", "H", "C", "D")) {
        for (i in 1..13) {
            if (!list.contains(Pair(mark, i))) {
                println(mark + " " + Integer.toString(i))
            }
        }
    }
}
