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