fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    var sList = mutableListOf<Int>()
    var hList = mutableListOf<Int>()
    var cList = mutableListOf<Int>()
    var dList = mutableListOf<Int>()

    for (i in 0 until n) {
        val (a, b) = readLine()!!.split(" ")
        when (a) {
            "S" -> sList.add(b.toInt())
            "H" -> hList.add(b.toInt())
            "C" -> cList.add(b.toInt())
            else -> dList.add(b.toInt())
        }
    }

    for (i in 1..13) {
        if (!sList.contains(i)) {
            println("S $i")
        }
    }

    for (i in 1..13) {
        if (!hList.contains(i)) {
            println("H $i")
        }
    }
    for (i in 1..13) {
        if (!cList.contains(i)) {
            println("C $i")
        }
    }
    for (i in 1..13) {
        if (!dList.contains(i)) {
            println("D $i")
        }
    }
}




