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

void main()
{
    char[4] suits  = ['S', 'H', 'C', 'D'];
    bool[13][4] cards = false;
    
    auto n = to!(int)(chomp(readln()));
    foreach (i; 0..n) {
        auto input = split(readln());
        auto idx = to!(int)(input[1]);

        switch (input[0]) {
        case "S":
            cards[0][idx - 1] = true;
            break;
        case "H":
            cards[1][idx - 1] = true;
            break;
        case "C":
            cards[2][idx - 1] = true;
            break;
        case "D":
            cards[3][idx - 1] = true;
            break;
        default:
            writeln("ERROR");
            break;
        }
    }

    foreach (i; 0..4) {
        foreach (j; 0..13) {
            if (!cards[i][j]) writeln(suits[i], ' ', j+1);
        }
    }
}