#include <iostream>
using namespace std;

int main(void){
    
    int n = 47;
    char type;
    int number;
    
    cin >> n;

    bool c[3][12] = {};
    
    for(int i = 0; i < 4; i++) {
        for(int j = 0; j < 13; j++) {
            c[i][j] = false;   
        }
    }
    
    while(n) {
        // cout << n;
        
        cin >> type >> number;
        
        // if(type == 'S' || type == 's' && 0 < number && number < 14) {
            
            if(c[0][number] != true) {
            
                c[0][number] = true;
                // n--;
                
            }
            
        // } else if(type == 'H' || type == 'h' && 0 < number && number < 14) {
            
            if(c[1][number] != true) {
            
                c[1][number] = true;
                // n--;
                
            }
            
        // } else if(type == 'C' || type == 'c' && 0 < number && number < 14) {
            
            if(c[2][number] != true) {
            
                c[2][number] = true;
                // n--;
                
            }
            
        // } else if(type == 'D' || type == 'd' && 0 < number && number < 14) {
            
            if(c[3][number] != true) {
            
                c[3][number] = true;
                // n--;
                
            }
            
        }
        
        n--;
    }
    
    for(int i = 0; i < 4; i++) {
        for(int j = 0; j < 13; j++) {
            if(c[i][j] == false) {
                if(i == 0) {
                    cout << "S" << " " << j + 1 << endl;
                } else if(i == 1) {
                    cout << "H" << " " <<  j + 1 << endl;
                } else if(i == 2) {
                    cout << "C" << " " << j + 1 << endl;
                } else if(i == 3) {
                    cout << "D" << " " << j + 1 << endl;
                }
            }
        }
    }
        
    return 0;
    
}