#include <stdio.h>
#include <stdbool.h>

int main(void){
  int n,i,j,rank;
  char mark;
  bool a[4][13] = true;
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    scanf("%c %d",&mark,&rank);//0:S 1:H 2:C 3:D
    a[mark][rank] = false;
  }
  for(mark = 0; mark < 4; mark++){
    for(rank = 0; rank < 13; rank++){
      if(a[mark][rank] == true){
      printf("%c %d\n",rank,mark);
      }
    }
  }
  return 0;
}
