#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int src, dst;
  int weight;
  Edge(int src, int dst, int weight) : src(src), dst(dst), weight(weight) {}
};
bool operator<(const Edge &e, const Edge &f) {
  return e.weight != f.weight ? e.weight > f.weight
         : e.src != f.src     ? e.src < f.src
                              : e.dst < f.dst;
}
int main() {
  int n;
  int S[13], H[13], C[13], D[13];
  memset(S, 0, sizeof S);
  memset(H, 0, sizeof H);
  memset(C, 0, sizeof C);
  memset(D, 0, sizeof D);
  scanf("%d", &n);
  for (int i = 0; i < (int)n; ++i) {
    char s;
    int num;
    scanf("%s %d", &s, &num);
    if (s == 'S')
      S[n - 1] == 1;
    else if (s == 'H')
      H[n - 1] == 1;
    else if (s == 'C')
      C[n - 1] == 1;
    else if (s == 'D')
      D[n - 1] == 1;
  }
  for (int i = 0; i < (int)13; ++i) {
    if (S[i] == 1) printf("S %d\n", i + 1);
  }
  for (int i = 0; i < (int)13; ++i) {
    if (H[i] == 1) printf("H %d\n", i + 1);
  }
  for (int i = 0; i < (int)13; ++i) {
    if (C[i] == 1) printf("C %d\n", i + 1);
  }
  for (int i = 0; i < (int)13; ++i) {
    if (D[i] == 1) printf("D %d\n", i + 1);
  }
  return 0;
}
