#include<iostream>
using namespace std;
int main(){
    int n,x;
    int card[4][13]={{}};
    char a;
    for(int i=0;i<4;i++){
        for(int j=0;j<13;){
            card[i][j]+=0
        }
    }
    for(int i=0;i<n;i++){
        cin>>a>>x;
        if(a=='H'){
            card[0][x-1]+=1;
        }
        else if(a=='D'){
            card[1][x-1]+=1;
        }
        else if(a=='S'){
            card[2][x-1]+=1;
        }
        else if(a=='C'){
            card[3][x-1]+=1;
        }
    }
    for(int i=0;i<4;i++){
        for(int j=0;j<13;){
            if(card[i][j]==0);
                if(a=='H'){
                    cout<<a<<" "<<x<<endl;
                }
                else if(a=='D'){
                    cout<<a<<" "<<x<<endl;
                }
                else if(a=='S'){
                     cout<<a<<" "<<x<<endl;
                }
                else if(a=='c'){
                     cout<<a<<" "<<x<<endl;
                }
        }
    }
    
    return 0;
}
