n = STDIN.gets.to_i
allsuit="SHCD"
arr=Array.new(52)
n.times {
  card=STDIN.gets.split
  suit=allsuit.index(card[0])
  num =card[1].to_i-1
  #printf("%d\n",suit*13+num)
  arr[suit*13+num]=1
}

0.upto(3) {|i|
  0.upto(12) {|j|
    printf("%s %d\n",allsuit[i],j+1) if arr[i*13+j]!=1
  }
}