#include<stdio.h>
#include<string.h>
int main(void){
        int i,n,j,num;
        int a[4][13]; //S = 0,H =1, C = 2, D =3
        char mark;
        scanf("%d",&n);
        for(j=0;j<4;j++){
                for(i=0;i<13;i++){
                        a[j][i] = 1;
                }
        }
        for(i=0;i<n;i++){
                scanf("%c",&mark);
                scanf("%d",&num);
                switch(mark){
                        case 'S' : a[0][num-1] = 0;
                        break;
                        case 'H' : a[1][num-1] = 0;
                        break;
                        case 'C' : a[2][num-1] = 0;
                        break;
                        case 'D' : a[3][num-1] = 0;
                        break;
                        }
        }
        printf("\n")
        for(i=0;i<13;i++){
                if(a[0][i] == 1) printf("S %d\n",i+1);
        }
        for(i=0;i<13;i++){
                if(a[1][i] == 1) printf("H %d\n",i+1);
        }
        for(i=0;i<13;i++){
                if(a[2][i] == 1) printf("C %d\n",i+1);
        }
        for(i=0;i<13;i++){
                if(a[3][i] == 1) printf("D %d\n",i+1);
        }
        return 0;
}