#include <stdio.h>
int main(void) {
    int card[4][13]={};
    int n,x,i,j,ch;
    scanf("%d",&n);
    for(i=0; i<n*2; i++){
        scanf("%c%d", &ch[0], &x);
        if(ch=='S')
            card[0][x-1] = 1;
        if(ch=='H')
            card[1][x-1] = 1;
        if(ch=='C')
            card[2][x-1] = 1;
        if(ch=='D')
            card[3][x-1] = 1;
    }
    puts("");
    for(i=0; i<4; i++){
        for(j=0; j<13; j++){
            if(card[i][j] != 1){
                if(i == 0)
                    printf("S %d\n", j+1);
                if(i == 1)
                    printf("H %d\n", j+1);
                if(i == 2)
                    printf("C %d\n", j+1);
                if(i == 3)
                    printf("C %d\n", j+1);
            }
        }
    }
    return 0;
}
