#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  char* cs = (char*)malloc(sizeof(char) * n);
  int* cd = (int*)malloc(sizeof(int) * n);
  for (int i = 0; i < n; ++i) {
    char s;
    int d;
    scanf("%c %d", &s, &d);
    cs[i] = s;
    cd[i] = d;
  }
  char t[] = {'S', 'H', 'C', 'D'};
  for (int i = 0; i < 4; ++i) {
    for (int j = 1; j <= 13; ++j) {
      bool isExist = false;
      for (int k = 0; k < n; ++k) {
        if (cs[k] == t[i] && cd[k] == j) {
          isExist = true;
          break;
        }
      }
      if (!isExist) {
        printf("%c %d\n", t[i], j);
      }
    }
  }
  free(cs);
  free(cd);
  return 0;
}
