#include<cstdio>

int main(void){
int i,j;
bool card[4][13];
for(i=0;i<4;i++){
	for(j=0;j<13;j++){
		card[i][j]=true;
	}
}
int n;
scanf("%d",&n);
//printf("%d\n",n);
char s[n][10],c[n];
int a[n];
int x[n];
for(i=0;i<n;i++){
	scanf("%s",s[i]);
	//printf("%s\n",s[i]);
	scanf("%d",&a[i]);
	a[i]--;
	//printf("%d\n",a[i]);
	c[i]=s[i][0];
	//printf("%c\n",c[i]);	
	s//printf("a[%d]=%d\n",i,a[i]);
	if(c[i]=='S'){
		x[i]=0;
	}else if(c[i]=='H'){
		x[i]=1;
	}else if(c[i]=='C'){
		x[i]=2;
	}else if(c[i]=='D'){
		x[i]=3;
	}
	card[x[i]][a[i]]=false;
}
for(j=0;j<13;j++){
	if (card[0][j]==true){
		printf("S %d\n",j+1);
	}
}
for(j=0;j<13;j++){
	if(card[1][j]==true){
		printf("H %d\n",j+1);
	}
}
for(j=0;j<13;j++){
	if(card[2][j]==true){
		printf("C %d\n",j+1);
	}
}
for(j=0;j<13;j++){
	if(card[3][j]==true){
		printf("D %d\n",j+1);
	}
}
return 0;
}