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