#include<stdio.h>

int main()
{
    int a,b,i, s[13]={1,2,3,4,5,6,7,8,9,10,11,12,13}; 
    int h[13]={1,2,3,4,5,6,7,8,9,10,11,12,13};
    int c[13]= {1,2,3,4,5,6,7,8,9,10,11,12,13};
    int d[13]= {1,2,3,4,5,6,7,8,9,10,11,12,13};
    char s;

    scanf("%d", &a);
    for(;i <= a;){

        scanf("%c%d", &s,&b);
        if (s =='S') s[b] = 0;
        if (s =='H') h[b] = 0;
        if (s =='C') c[b] = 0;
        if (s =='D') d[b] = 0;
    }
    for(i=1; i<=13,i++){
	if(s[i] != 0)printf("S %d\n",s[i]);}
    for(i=1; i<=13,i++){
	if(h[i] != 0)printf("H %d\n",h[i]);}
    for(i=1; i<=13,i++){
	if(s[i] != 0)printf("C %d\n",c[i]);}
    for(i=1; i<=13,i++){
	if(s[i] != 0)printf("D %d\n",d[i]);}

    return 0;
}

