import scala.io.StdIn
import scala.annotation.tailrec

/**
  * AOJ
  */
object Main {

  def main(args: Array[String]): Unit = {

    val inputCards = getInputCards(StdIn.readInt(),0,Set())

    val suits = List("S","H","C","D")
    for(suit <- suits; number <- 1 to 13){
      if(!inputCards.contains(Card(suit,number))){
        println("%s %d".format(suit,number))
      }
    }
  }

  @tailrec
  def getInputCards(n:Int, i:Int, cards:Set[Card]): Set[Card] ={
    if(i == n){return cards}
    val in = StdIn.readLine().split(" ")
    getInputCards(n,i + 1,cards + Card(in(0).toString,in(1).toInt))
  }
}

case class Card(suit:String,number:Int)