#include <bits/stdc++.h>
int main(void) {
  int n, num, i, j;
  char mark[256];
  bool cards[4][13];
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      cards[i][j] = false;
    }
  }
  scanf("%d", &n);
  if (n > 52) {
    return 0;
  }
  for (i = 0; i < n; i++) {
    scanf("%s %d", mark, &num);
    if (num >= 1 && num <= 13) {
      if (strcmp(mark, "S") == 0) {
        cards[0][num - 1] = true;
      } else if (strcmp(mark, "H") == 0) {
        cards[1][num - 1] = true;
      } else if (strcmp(mark, "C") == 0) {
        cards[2][num - 1] = true;
      } else if (strcmp(mark, "D") == 0) {
        cards[3][num - 1] = true;
      } else {
        return 0;
      }
    } else {
      return 0;
    }
  }
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      if (cards[i][j] == false) {
        switch (i) {
          case 0:
            printf("S");
            break;
          case 1:
            printf("H");
            break;
          case 2:
            printf("C");
            break;
          case 3:
            printf("D");
            break;
          default:
            break;
        }
        printf(" %d\n", j + 1);
      }
    }
  }
  return 0;
}
