#include <stdio.h>
int main (){
int x[4][14]=0,a,b,c,d,e;
char y;
scanf ("%d",&a);
for (b=0;b<a;b++){
scanf ("%c %d",&c,&d);
if (c=='S'){
x[1][d]=1;}
else if (c=='H'){
x[2][d]=1;}
else if (c=='C'){
x[3][d]=1;}
else if (c=='D'){
x[4][d]=1;}
for (e=1;e<14;e++){
if (x[1][d]){printf("S %d",e)
}
}
for (e=1;e<14;e++){
if (x[2][d]){printf("H %d",e)
}
}
for (e=1;e<14;e++){
if (x[3][d]){printf("C %d",e)
}
}
for (e=1;e<14;e++){
if (x[4][d]){printf("D %d",e)
}
}
return 0;
}
