import std.stdio, std.string, std.conv, std.range, std.algorithm;

void main() {
	auto _n = readln;
	string[] n, d = [];
	foreach (string l; lines(stdin)) n ~= l.chomp;
	
	["S", "H", "C", "D"].each!(_s => iota(1, 14).each!(_i => d ~= "%s %d".format(_s, _i)));
	auto r = d.filter!(a => !n.canFind(a));
	r.each!(a => a.writeln);
}