#include <stdio.h>

int main() {

  int cards[4][13] = {0};
  char class;
  int num, n;
  int i = 0, j;

  scanf("%d", &n);
  
  while(i < n) {
    scanf("%c %d", &class, &num);
    switch(class) {
    case 'S': cards[0][num] = num; break;
    case 'H': cards[1][num] = num; break;
    case 'C': cards[2][num] = num; break;
    case 'D': cards[3][num] = num; break;
    default: break;
    }
  }

  for(i = 0; i < 4; i++)
    for(j = 0; j < 13; j++)
      if(!cards[i][j]) {
	switch(i) {
	case 'S': printf("S "); break;
	case 'H': printf("H "); break;
	case 'C': printf("C "); break;
	case 'D': printf("D "); break;
	default: break;
	}
	printf("%d\n", cards[i][j]);
      }
	
  return 0;
  
}