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