n = gets.chomp.to_i
memo={"S" => 0, "H" => 0, "C" => 0, "D" => 0}

n.times do
    mark,number = gets.chomp.split(" ")
    memo[mark]=memo[mark]|(1 << (number.to_i-1))
end

memo.each{|key,value|
    13.times do |x|
        if value&(1 << x)==0 then
            print(key," ",x+1,"\n")
        end
    end
}