#include <bits/stdc++.h>
int main() {
  int n, i, j, k, l, c;
  char m[4] = {'S', 'H', 'C', 'D'};
  scanf("%d", &n);
  char a[n];
  int b[n];
  for (i = 0; i < n; i++) {
    scanf("%c %d", &a[i], &b[i]);
  }
  for (j = 0; j < 4; j++) {
    for (k = 1; k < 14; k++) {
      for (l = 0; l < n; l++) {
        if (a[l] == m[j] && b[l] == k) {
          c = 1;
          break;
        } else {
          c = 0;
        }
      }
      if (c == 0) {
        printf("%c %d\n", m[j], k);
      }
    }
  }
  return 0;
}
