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

void main() {
    string[] mark = ["S", "H", "C", "D"];
    bool[] cards = new bool[52];
    int n = readln.chomp.to!int;
    foreach (i; 0 .. n) {
        string[] tmp = readln.chomp.split;
        cards[mark.countUntil(tmp[0])*13+tmp[1].to!int-1] = true;
    }
    foreach (i; 0 .. 52) {
        if (cards[i] == false) {
            writeln(mark[i/13], " ", i % 13 + 1);
        }
    }
}
