scount=Array.new
hcount=Array.new
ccount=Array.new
dcount=Array.new
for i in 1..13 do
  scount[i]=0
  hcount[i]=0
  ccount[i]=0
  dcount[i]=0
end
n=gets.chomp.to_i
for i in 1..n do
  input=gets.chomp
  line=input.split
  if line[0]=='S' then
    scount[line[1].to_i]=1
  elsif line[0]=='H' then
    hcount[line[1].to_i]=1
  elsif line[0]=='C' then
    ccount[line[1].to_i]=1
  elsif line[0]=='D' then
    dcount[line[1].to_i]=1
  end
end
for i in 1..n do
  if scount[i]==0
    puts "S #{i}"
  end
end
for i in 1..n do
  if hcount[i]==0
    puts "H #{i}"
  end
end
for i in 1..n do
  if ccount[i]==0
    puts "C #{i}"
  end
end
for i in 1..n do
  if dcount[i]==0
    puts "D #{i}"
  end
end