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

void main()
{
   string[string] cards;
    auto n = readln.strip.to!int;

    foreach(i;0..n) {
        auto s = readln;
        cards[s] = s;
    }

    foreach(i;["S","H","C","D"]) {
        foreach(j;0..13){
            string str = i ~ " " ~ (j+1).to!string ~ "\n";
            if(cards.get(str,"")=="") {
                write(str);
            }
        }
    }
}