#include<stdio.h>

int main(){
  int n,i,x;
  int card[4][13]=0;
  char p;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%c %d",&p,&x);
    switch(p){
      case "S":card[0][x-1]=x;break;
      case "H":card[1][x-1]=x;break;
      case "C":card[2][x-1]=x;break;
      case "D":card[3][x-1]=x;break;
    }
  }
  for(i=0;i<4;i++){
    for(j=0;j<13;j++){
      if(card[i][j]==0){
        switch(i){
          case 0:printf("S %d\n",j+1);break;
          case 1:printf("H %d\n",j+1);break;
          case 2:printf("C %d\n",j+1);break;
          case 3:printf("D %d\n",j+1);break;
        }
      }
    }
  }

  return 0;
}