#include <stdio.h>

int main(void) {
	int i,j,p,n,num,s[4][13]={0};
	char suit,ref[]="SHCD";
	scanf("%d",&n);
	for (i=0;i<n;i++){
		scanf("%c %d",&suit,&num);
		switch(suit){
			case 'S': p=0;break;
			case 'H': p=1;break;
			case 'C': p=2;break;
			case 'D': p=3;break;
		}
		[p][num-1]=1;
	}
	for (i=0;i<4;i++){
		for (j=0;j<13;j++){
			if (s[i][j]==0){
				printf("%c %d\n",ref[i],j+1);
			}
		}
	}
	return 0;
}