n = gets.to_i
card = Array.new(52,1)

for i in 1..n do
  a,b = gets.split
  b = b.to_i
  card[b-1] = 0 if a == "S"
  card[b+12] = 0 if a == "H"
  card[b+25] = 0 if a == "C"
  card[b+38] = 0 if a == "D"
end

for i in 1..52 do
  if card[i-1] == 1 && i<14
     puts "S #{i}"
  elsif card[i-1] ==1 && i<27
     puts "H #{i-13}" 
  elsif card[i-1] ==1 && i<40
     puts "C #{i-26}" 
  elsif card[i-1] ==1
     puts "D #{i-39}"
  end
end

