#include <stdio.h>
int main(){
    int n,i,j,k,num;
    char mark;
    int cards[4][14];
    for(i=0;i<4;i++){
        for(j=1;j<=13;j++){
            cards[i][j]=0;
        }    
    }
    
    scanf("%d",&n);
    for(k=0;k<n;k++){
            scanf("%c %d",&mark,&num);
            if(mark=='S') cards[0][num]=1;
            if(mark=='H') cards[1][num]=1;
            if(mark=='C') cards[2][num]=1;
            if(mark=='D') cards[3][num]=1;
    }
    
    for(i=0;i<4;i++){
        for(j=1;j<=13;j++){
            if(cards[i][j]) continue;
            if(i==0) mark='S';
            if(i==1) mark='H';
            if(i==2) mark='C';
            if(i==3) mark='D';
            printf("%c %d\n",mark,j);
        }
    }
    return 0;
