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


void main()
{
    int n = 0;
    readf("%d\n", &n);
    auto a = new Tuple!(string, int)[n];
    for (int i = 0; i < n; i++)
    {
        auto k = readln().strip.split(" ");
        a[i] = tuple(k[0], k[1].to!int);
    }
    a.sort!((x, y) => x[1] < y[1]);
    void nhuiewrwu(string l)
    {
        int old = 1;
        foreach (a ; a.filter!(x => x[0] == l))
        {
            for (int i = old; i < a[1]; i++)
                writeln(l, " ", i);
            old = a[1] + 1;
        }
            for (int i = old; i < 14; i++)
                writeln(l, " ", i);
    }
    nhuiewrwu("S");
    nhuiewrwu("H");
    nhuiewrwu("C");
    nhuiewrwu("D");
}

