#include<stdio.h>
int main(){
int a,b,c,d,e,f,g,h,kado[5][14]={{}};
char A,B,C,D,E,F,G;
scanf("%d",&a);
for(b=0;b<a;b++){
scanf("%c %d",&A,&c)
switch(A){
case 'S':
 kado[1][c]=1;
 break;
case 'H':
 kado[2][c]=1;
 break;
case 'C':
 kado[3][c]=1;
 break;
case 'D':
 kado[4][c]=1;
 break;
}}
for(b=1;b<5;b++){
for(e=1;e<14;e++){
if(kado[b][e]==1){
switch(b){
case 1:
 printf("S %d\n",e);
 break;
case 2:
 printf("H %d\n",e);
 break;
case 3:
 printf("C %d\n",e);
 break;
case 4:
 printf("D %d\n",e);
 break;
}}}}




return 0;
}