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

int main(){
    
    int n;
    cin>>n;
    
    int card[4][13]= {};
    
    for (int i=0; i<n; i++)
        
        string suit;
        
        int num;
        
        cin>>suit>>num;
        
        string str[4];
        
        if(num="S")card[0][num-1] = 1;
        if(num="H")card[1][num-1] = 1;
        if(num="C")card[2][num-1] = 1;
        if(num="D")card[3][num-1] = 1;
    }
    
    string str[4] = { "S","H","C","D" };
    
    fot(int i=0; i<4; i++){
        for(int j=0; j <13; j++){
            if (card[i][j] = 1) continue;
            else cout<<str[i]<<j++<<endl;
    }
    cout<<endl;
    }
    return 0;
}
