#include<stdio,h>

int main(void){
	int S[13]={0},H[13]={0},C[13]={0},D[13]={0};
	int num,i,n;
	char mark;
	
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d %c",&num,&mark);	//mark??¨num?????\???
		
		switch(mark){
		case 'S':
			S[num]=1;
			break;
		case 'H':
			H[num]=1;
			break;
		case 'C':
			C[num]=1;
			break;
		case 'D':
			D[num]=1;
			break;
		}
	}
	for(i=0;i<13;i++){
	if(S[i]==0){
		printf("S %d\n",i+1);
	}
	for(i=0;i<13;i++){
	if(H[i]==0){
		printf("H %d\n",i+1);
	}
	}
	for(i=0;i<13;i++){
	if(C[i]==0){
		printf("C %d\n",i+1);
	}
	for(i=0;i<13;i++){
	if(D[i]==0){
		printf("D %d\n",i+1);
	}
	return 0;
}