#include <bits/stdc++.h>
int main(void) {
  int n, inp;
  int S[13];
  int H[13];
  int C[13];
  int D[13];
  char st;
  scanf("%d", &n);
  for (int i = 0; i < n * 2; i++) {
    scanf("%c", &st);
    switch (st) {
      case 'S':
        scanf("%d", &inp);
        S[inp] = 1;
        break;
      case 'H':
        scanf("%d", &inp);
        H[inp] = 1;
        break;
      case 'C':
        scanf("%d", &inp);
        C[inp] = 1;
        break;
      case 'D':
        scanf("%d", &inp);
        D[inp] = 1;
        break;
    }
  }
  for (int _S = 1; _S <= 13; _S++) {
    if (S[_S] != 1) printf("S %d\n", _S);
  }
  for (int _H = 1; _H <= 13; _H++) {
    if (H[_H] != 1) printf("H %d\n", _H);
  }
  for (int _C = 1; _C <= 13; _C++) {
    if (C[_C] != 1) printf("C %d\n", _C);
  }
  for (int _D = 1; _D <= 13; _D++) {
    if (D[_D] != 1) printf("D %d\n", _D);
  }
  return 0;
}
