"use strict";
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});
/* 入力は 
 */

var re = /\s+|$/;
var kinds=['S','H','C','D'];
var seq=[...Array(14).keys()];
    seq.shift()

reader.on('close', () => {
    var n = Number(lines.shift());
    var cards={};
    for (var i of kinds) {
	cards[i]=[];
    }

    var k, r;
    for (var l of lines) {
	[k, r] = l.trim().split(re);
	cards[k].push(Number(r));
    }

//    for (var i of kinds) {
//	console.log('kind: ',i,'cards: ', cards[i]);
//    }
    
    var result = aux(cards);
/*
    for (var i of kinds) {
	console.log('kind: ',i,'result: ', result[i].map(String).join(' '));
    }
*/

    for (var i of kinds) {
	var sa = result[i].sort((a,b)=>a-b).map(String);
	for (var j  of sa) {
	    console.log(i, j);
	}
    }

});

function aux(cards)
{
    var result={};
    for (var i of kinds) {
	result[i] = [];
    }

    for (var i of kinds) {
	for (var j of seq) {
	    if (cards[i].indexOf(j) == -1){
		result[i].push(j);
	    }
	}}

    return(result);
}
