var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = input.split(/\n/g);

var cards = {'S':[],'H':[],'C':[],'D':[]};

for (var key in cards) {
    for (var i = 1; i <= 13; i++) {
        cards[key].push(i);
    }
}

for (var i = 1; i <= lines[0]; i++) {
    var line = lines[i].split(' ');
    
    var index = cards[line[0]].indexOf(+line[1]);
    cards[line[0]].splice(index, 1);
}

for (var key in cards) {
    for (var i = 0; i < cards[key].length; i++) {
        console.log(key + ' ' + cards[key][i]);
    }
}