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