#include <stdio.h>
#include <string.h>

typedef struct{
  int H;
  int S;
  int D;
  int C;
}CARD;

int main(void){

  int num;
  int c;
  int number;
  CARD card[13];

  scanf("%d",&num);

  for(int i=0; i<num; i++){
     scanf("%c %d",c,&number);
     
     if(c == 'H')
        card[number - 1].H = 1;
     else if(c == 'S')
        card[number - 1].S = 1;
     else if(c == 'D')
        card[number - 1].D = 1;
     else if(c == 'C')
        card[number - 1].C = 1;

     memset(str,0,sizeof(c));
     memset(number,0,sizeof(number));
  }
  
  for(int i=0; i<13; i++){
     if(card[i].H == 0)
        printf("H %d\n",i + 1);
     if(card[i].S == 0)
        printf("S %d\n",i + 1);
     if(card[i].D == 0)
        printf("D %d\n",i + 1);
     if(card[i].C == 0)
        printf("C %d\n",i + 1);
  }

  return 0;
}