function range(from, to) {
    var range = [];
    for (var i = from; i <= to; i++) {
        range.push(i);
    }
    return range;
}

const chunk = require('fs').readFileSync('/dev/stdin', 'utf8');

const existCard = chunk.split('\n').slice(1);


const suits = ['S', 'H', 'C', 'D'];
const ranks = range(1, 13);

for (var i = 0; i < suits.length; i++) {
    for (var j = 0; j < ranks.length; j ++) {
        var card = suits[i] + ' ' + ranks[j];
        if (existCard.indexOf(card) === -1) {
            console.log(card);
        }
    }
}