#include <bits/stdc++.h>
#pragma warning(disable : 4996)
int main(void) {
  int n, x, z;
  char s, y;
  int card[4][13] = {0};
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &y);
    scanf("%d", &x);
    switch (x) {
      case 'S':
        z = 0;
        break;
      case 'H':
        z = 1;
        break;
      case 'C':
        z = 2;
        break;
      case 'D':
        z = 3;
        break;
    }
    card[z][x - 1] = 1;
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (card[i][j] == '\0') {
        switch (i) {
          case 0:
            s = 'S';
            break;
          case 1:
            s = 'H';
            break;
          case 2:
            s = 'C';
            break;
          case 3:
            s = 'D';
            break;
        }
        printf("%c %d\n", s, j + 1);
      }
    }
  }
  return 0;
}
