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