#include<stdio.h>

int main()
{
    int a,c,i,j;
    int cards[4][13]={0};
    char b[4],d[4]={'S','H','C','D'};
    scanf("%d\n",&a);
    for(i=0;i<a-1;i++){
    	scanf("%c %d\n",&b,&c);
        int cards[b][c]={1};
    }
    for(i=0;i<4;i++){
    	for(j=1;j<14;j++){
    		if(!cards[d[i]][j]){
    		    printf("%c %d\n",d[i],j);
    		}
    	}
    }
    return 0;
}