#include <bits/stdc++.h>
int main(void) {
  int n, i, j, k, trump[4][13];
  char cards, marks;
  scanf("%d", &n);
  for (k = 0; k < n; k++) {
    scanf("%c", &cards);
    if (cards == 'S') {
      i = 0;
      scanf("%d\n", &j);
      trump[i][j - 1] = j;
    }
    if (cards == 'H') {
      i = 1;
      scanf("%d\n", &j);
      trump[i][j - 1] = j;
    }
    if (cards == 'C') {
      i = 2;
      scanf("%d\n", &j);
      trump[i][j - 1] = j;
    }
    if (cards == 'D') {
      i = 3;
      scanf("%d\n", &j);
      trump[i][j - 1] = j;
    }
  }
  for (i = 0; i < 4; i++) {
    for (j = 1; j <= 12; j++) {
      if (trump[i][j - 1] == j) {
      } else {
        if (i == 0) {
          marks = 'S';
          printf("%c %d\n", marks, j);
        }
        if (i == 1) {
          marks = 'H';
          printf("%c %d\n", marks, j);
        }
        if (i == 2) {
          marks = 'C';
          printf("%c %d\n", marks, j);
        }
        if (i == 3) {
          marks = 'D';
          printf("%c %d\n", marks, j);
        }
      }
    }
  }
  return 0;
}
