num=STDIN.gets.to_i
member=["1","2","3","4","5","6","7","8","9","10","11","12","13"]
S=Array.new(member)
H=Array.new(member)
C=Array.new(member)
D=Array.new(member)
i=0
while str=STDIN.gets
    i=i+1
    op1,op2=str.chomp.split.map{|v|v.to_s}
    if op1=="S" then S.delete(op2) end
    if op1=="H" then H.delete(op2) end
    if op1=="C" then C.delete(op2) end
    if op1=="D" then D.delete(op2) end
    break if i==num
end

S.each do |elm|
print "S ",elm,"\n"
end
H.each do |elm|
print "H ",elm,"\n"
end
C.each do |elm|
print "C ",elm,"\n"
end
D.each do |elm|
print "D ",elm,"\n"
end