#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  bool spade[13] = {false};
  bool hart[13] = {false};
  bool club[13] = {false};
  bool dia[13] = {false};
  char suit;
  char str[5];
  int rank = 0;
  getchar();
  for (int id = 0; id < n; id++) {
    fgets(str, 5, stdin);
    sscanf(str, "%c %d", &suit, &rank);
    printf("suit = %d, id = %d, rank = %d\n", suit, id, rank);
    switch (suit) {
      case 'S':
        scanf(" %d", &rank);
        for (int i = 0; i < 13; i++) {
          if (i + 1 == rank) spade[i] = true;
        }
        break;
      case 'H':
        scanf(" %d", &rank);
        for (int i = 0; i < 13; i++) {
          if (i + 1 == rank) hart[i] = true;
        }
        break;
      case 'C':
        scanf(" %d", &rank);
        for (int i = 0; i < 13; i++) {
          if (i + 1 == rank) club[i] = true;
        }
        break;
      case 'D':
        scanf(" %d", &rank);
        for (int i = 0; i < 13; i++) {
          if (i + 1 == rank) dia[i] = true;
        }
        break;
      default:
        break;
    }
  }
  for (int i = 0; i < 13; i++) {
    if (spade[i] == false) printf("S %d\n", i + 1);
  }
  for (int i = 0; i < 13; i++) {
    if (hart[i] == false) printf("H %d\n", i + 1);
  }
  for (int i = 0; i < 13; i++) {
    if (club[i] == false) printf("C %d\n", i + 1);
  }
  for (int i = 0; i < 13; i++) {
    if (dia[i] == false) printf("D %d\n", i + 1);
  }
  return 0;
}
