n = STDIN.gets.to_i

cards = {
        'S' => [],
        'H' => [],
        'C' => [],
        'D' => []
}
missing = {
        'S' => [],
        'H' => [],
        'C' => [],
        'D' => []
}

n.times {
        card = STDIN.gets.split(' ')
        cards[card[0]].push(card[1].to_i)
}

cards.each {|k,v| cards[k].sort! }

cards.each {|k,v|
        for i in 1..13
                missing[k].push(i) if ! v.include?(i)
        end
}

missing.each {|k,v|
        v.each {|val|
                puts k.to_s + ' ' + val.to_s
        }
}