#include<stdio.h>
#define NUM 13

int main(){
 int num[NUM*4-1],ncmp[NUM*4-1],n,i,j;
 char pcmp[NUM*4-1];
 for(i=0; i<NUM; i++){
  num[NUM*0+i] = i+1;
  num[NUM*1+i] = i+1;
  num[NUM*2+i] = i+1;
  num[NUM*3+i] = i+1;
 }
 scanf("%d", &n);
 for(i=0; i<n; i++){
  scanf("%c%d",&pcmp[i],&ncmp[i]);
 }
 for(i=0; i<n; i++){
  for(j=0; j<NUM-1; j++){
   switch("pcmp[i]"){
    case 'S': if(ncmp[i]==num[NUM*0+j]){num[NUM*0+j] = -1;} break;     
    case 'H': if(ncmp[i]==num[NUM*1+j]){num[NUM*1+j] = -1;} break;
    case 'C': if(ncmp[i]==num[NUM*2+j]){num[NUM*2+j] = -1;} break;
    case 'D': if(ncmp[i]==num[NUM*3+j]){num[NUM*3+j] = -1;} break;
    default: break;
   }
  }
 }
 for(i=0; i<NUM*4-1; i++){
   if(num[i]!=-1){
    if(i<NUM){printf("S %d\n", num[i]);}
    else if(i<NUM*2){printf("H %d\n", num[i]);}
    else if(i<NUM*3){printf("C %d\n", num[i]);}
    else {printf("D %d\n", num[i]);}
   }
  }
 }
 return 0;
}