object Main {

    def main(args: Array[String]): Unit = {
        val sc = new java.util.Scanner(System.in)
        val n = sc.nextInt
        val a = Array.fill(n)( (sc.next, sc.nextInt) )
        val found = a.map{
            case (suit, num) => cards_toIndex(suit, num)
        }.toSet

        ((0 to 51).toSet &~ found).toSeq.sorted.foreach{
            i => {
                i/13 match {
                    case 0 => println("S " + (i%13+1))
                    case 1 => println("H " + (i%13+1))
                    case 2 => println("C " + (i%13+1))
                    case 3 => println("D " + (i%13+1))
                }
            }
        }
    }

    // 0 to 51
    def cards_toIndex(suit: String, num: Int): Int = {
        suit match {
            case "S" => num-1
            case "H" => 13+num-1
            case "C" => 26+num-1
            case "D" => 39+num-1
            case _ => -1
        }
    }

}

