def printRest(rest, str)
  rest.each do |r|
    printf "#{str} #{r}\n"
  end
end

S = (1..13).to_a
H = (1..13).to_a
C = (1..13).to_a
D = (1..13).to_a
s = []
h = []
c = []
d = []

n = gets.to_i
for i in 1..n do
  a = gets.chomp.split(' ')
  key = a[0].to_s
  val = a[1].to_i
  case key
    when "S"
      s.push val
    when "H"
      h.push val
    when "C"
      c.push val
    when "D"
      d.push val
    end
end

rS = S - s
rH = H - h
rC = C - c
rD = D - d

printRest(rS, "S")
printRest(rH, "H")
printRest(rC, "C")
printRest(rD, "D")