#include <iostream>
using namespace std;

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