#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  bool a[4][13] = {false};
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    char suit;
    int rank;
    scanf("%c %d", &suit, &rank);
    switch (suit) {
      case 'S':
        a[0][rank - 1] = true;
        break;
      case 'H':
        a[1][rank - 1] = true;
        break;
      case 'C':
        a[2][rank - 1] = true;
        break;
      case 'D':
        a[3][rank - 1] = true;
        break;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (!a[i][j]) {
        switch (i) {
          case 0:
            printf("S %d\n", j + 1);
            break;
          case 1:
            printf("H %d\n", j + 1);
            break;
          case 2:
            printf("C %d\n", j + 1);
            break;
          case 3:
            printf("D %d\n", j + 1);
            break;
        }
      }
    }
  }
  return 0;
}
