#include <bits/stdc++.h>
int main() {
  int x[4][13] = {0};
  int n;
  char S;
  int s;
  int u;
  scanf("%d", &n);
  int m = 1;
  while (m <= 2 * n) {
    scanf("%c %d", &S, &s);
    switch (S) {
      case 'S':
        u = 1;
        break;
      case 'H':
        u = 2;
        break;
      case 'C':
        u = 3;
        break;
      case 'D':
        u = 4;
        break;
    }
    x[u][s] = 1;
    m++;
  }
  for (int i = 1; i <= 4; i++) {
    for (int j = 1; j <= 13; j++) {
      if (x[i][j] == 0) {
        switch (i) {
          case 1:
            S = 'S';
            break;
          case 2:
            S = 'H';
            break;
          case 3:
            S = 'C';
            break;
          case 4:
            S = 'D';
            break;
        }
        printf("%c %d\n", S, j);
      }
    }
  }
  return 0;
}
