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

void main() {
	auto _n = readln;
	string[] n = [];
	string line;
	while((line = readln.chomp) != "") {
		n ~= line;
	}

	foreach (_s; ["S", "H", "C", "D"])
		foreach (_i; 1..14) {
			auto t = _s ~ " " ~ _i.to!string;
			if (!n.canFind(t)) t.writeln;
		}
}