import java.util.*

enum class Suit {
    S, H, C, D
}

data class Cards(val suit: Suit, val num: Int)

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    val list = mutableListOf<Cards>()
    (1..n).forEach {
        list.add(Cards(Suit.valueOf(scanner.next()), scanner.nextInt()))
    }
    list.reverse()
    Suit.values().forEach { suit -> (1..13).forEach {num ->
        if (!list.contains(Cards(suit, num))) {
            println("${suit} ${num}")
        }
    } }
}
