#include <bits/stdc++.h>
using namespace std;

int main() {
    bool tramp[4][13];
    for(int a = 0; a < 4; ++a) {
        for(int b = 0; b < 13; ++b) {
            tramp[a][b] = false;
        }
    }
    
    int N;

    cin >> N;

    for(int c = 0; c < N; ++c) {
        char kind;
        int number;
        cin >> kind >> number;
        switch(kind) {
            case 'S': tramp[0][number-1] = true;
             break;
            case 'H': tramp[1][number-1] = true;
             break;
            case 'C': tramp[2][number-1] = true;
             break;
            case 'D': tramp[3][number-1] = true;
             break
        }
    }

    for(int f = 0; f < 4; ++f) {
        for(int g = 0; g < 4; ++ g) {
            if(tramp[f][g] == false) {
                char kind2;
                if(f == 0) {
                    kind2 = 'S';
                }else if(f == 1) {
                    kind2 = 'H';
                }else if(f == 2) {
                    kind = 'C';
                }else if(f == 3) {
                    kind = 'D';
                }
                cout << kind2 << " " << g << endl;
            }
        }
    }
}