#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);
    switch (c) {
      case 'S':
        card[0][x - 1] = true;
      case 'H':
        card[1][x - 1] = true;
      case 'C':
        card[2][x - 1] = true;
      case 'D':
        card[3][x - 1] = true;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (card[i][j] == false) {
        switch (i) {
          case 0:
            printf("S %d", j + 1);
          case 1:
            printf("H %d", j + 1);
          case 2:
            printf("C %d", j + 1);
          case 3:
            printf("D %d", j + 1);
        }
        printf("\n");
      }
    }
  }
  return 0;
}
