#include<iostream>
using namespace std;

int main(){
    int card[4][13];
    int n,c,num;
    
    cin >> n;
    
    for (int i = 0; i < n; i++){
        cin >> c;
        if (c == 'S'){
            cin >> num;
            card[1][num] = 1;
        } else if (c == 'H'){
            cin >> num;
            card[2][num] = 1;
        } else if (c == 'C'){
            cin >> num;
            card[3][num] = 1;
        } else if (c == 'D'){
            cin >> num;
            card[4][num] = 1;
        }
    }
    
    for (int j = 0; j < 4; j++){
        for (int k = 0; k < 13; k++){
            if (card[j][k] == False){
                if (i == 0){
                    cout << "H" << " " << k+1 << endl;
                } else if(i == 1){
                    cout << "S" << " " << k+1 << endl;
                } else if(i == 2){
                    cout << "C" << " " << k+1 << endl;
                } else if(i == 3){
                    cout << "D" << " " << k+1 << endl;
                }
            }
        }
    }
        
    return 0;
}
        