#include <stdio.h>
int main(){

  int n,i,s,l,j;
  int cards[4][13];

  scanf("%d",&n);

  for(i=0;i<4;i++){
    for(j=0;j<13;j++){
      cards[i][j]=0;
    }
  }

  for(i=0;i<n;i++){
    scanf("%d%d",&s,&l);
    switch(s){
    case S:
      cards[0][l]=1;
      break;
    case H:
      cards[1][l]=1;
      break;
    case C:
      cards[2][l]=1;
      break;
    default:
      cards[3][l]=1;
      break;
    }
  }

  for(i=0;i<4;i++){
    if(i==0) printf("S ");
    else if(i==1) printf("H ");
    else if(i==2) printf("C ");
    else printf("D ");
    for(j=0;j<13;j++){
      if(cards[i][j]==0){
	printf("%d\n",j);
      }
    }
  }

  return 0;
}