#include<stdio.h>
#include<string.h>
int main(void){
	int i,n,j,oppai;
	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 %d",&mark,&oppai);
		switch(mark){
			case 'S' : a[0][oppai-1] = 0;
			break;
			case 'H' : a[1][oppai-1] = 0;
			break;
			case 'C' : a[2][oppai-1] = 0;
			break;
			case 'D' : a[3][oppai-1] = 0;
			break;
			}
	}
	for(i=0;i<n;i++){
		if(a[0][i] == 1) printf("S %d\n",(i+1));
	}
	for(i=0;i<n;i++){
		if(a[1][i] == 1) printf("H %d\n",(i+1));
	}
	for(i=0;i<n;i++){
		if(a[2][i] == 1) printf("C %d\n",(i+1));
	}
	for(i=0;i<n;i++){
		if(a[3][i] == 1) printf("D %d\n",(i+1));
	}
	return 0:
}