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;
	foreach (_s; ["S", "H", "C", "D"])
		foreach (_i; 1..14) {
			auto t = "%s %d".format(_s, _i);
			auto t = _s ~ " " ~ _i.to~string;
			if (!n.canFind(t)) t.writeln;
		}
}