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