#include<stdio.h>

struct card{
    unsigned short rank;
    unsigned char mark;
    unsigned char frg;
}
int main(){
    unsigned short num;
    unsigned short i, j, k;
    unsigned short rank;
    unsigned char mark;
    struct card card[52];
    for(i = 0;i < 4;i++){
        for(j = 0;j < 13;j++){
            card[i * 13 + j].rank = j + 1;
            switch(i){
            case 0:
                card[i * 13 + j].mark = 'S';
                break;
            case 1:
                card[i * 13 + j].mark = 'H';
                break;
            case 2:
                card[i * 13 + j].mark = 'C';
                break;
            case 3:
                card[i * 13 + j].mark = 'D';
                break;
            defoult:;
            }
            card[i * 13 + j].frg = 0;
        }
    }
    scanf("%d", &num);
    for(i = 0;i < num;i++){
        scanf("%c %d", &mark, &rank);
        for(j = 0;j < 52;j++){
            if(card[j].mark == mark && card[j].rank == rank){
                card[j].frg = 1; 
            }
        }
    }
    for(i = 0;i < 52;i++){
        if(card[i].frg == 0){
            printf("%c %d\n", card[i].mark, card[i].rank);
        }
    }
    return 0;
}
