#include<stdio.h>

int main(){
 int n,i,X[55],B;
 char A,M;
 X[0]=0;
 for(i=1;i<=52;i++){
  X[i]=1;}
 scanf("%d",&n);
 for(i=1;i<=n;i++){
  scanf("%c %d",&A,&B);
  if(i!=n) scanf("%c",m);
  if(A=='H'){
   B=B+13;}
  if(A=='C'){
   B=B+26;}
  if(A=='D'){
   B=B+39;}
  X[B]=0;}
 for(i=1;i<=52;i++){
  if(X[i]=1){
   if((i-1)/13==0){
    printf("S %d\n",i);}
   if((i-1)/13==1){
    printf("H %d\n",i-13);}
   if((i-1)/13==2){
    printf("C %d\n",i-26);}
   if((i-1)/13==3){
    printf("D %d\n",i-39);}}}
  return 0;}