#include<iostream>
using namespace std;

int main(){
    bool cards[4][14];
    int n, r;
    char s;
    for ( int i = 0; i < 4; i++ ){
        for ( int j = 1; j <= 13; j++){
            cards[i][j] = 0;
        }
    }
    cin >> n;
    for ( int i = 0;i < n; i++ ){
        cin >> s >> r;
        if ( s == 'S' ) cards[0][r] = 1;
        if ( s == 'H' ) cards[1][r] = 1;
        if ( s == 'C' ) cards[2][r] = 1;
        if ( s == 'D' ) cards[3][r] = 1;
    }
    for ( int i = 0; i < 4; i++ ){
        for ( int j = 1;j <= 13; j++ ){
            if ( c[i][j] ) continue;
            if ( i == 0) s = 'S';
            if ( i == 1) s = 'H';
            if ( i == 2) s = 'C';
            if ( i == 3) s = 'D';
            cout << s << " " << j << endl;
        }
    }
    return 0;
}
