#include <bits/stdc++.h>
int main() {
  long X[4];
  X[1] = 'S';
  X[2] = 'H';
  X[3] = 'C';
  X[4] = 'D';
  char x[4][13];
  int a = 1;
  int b = 1;
  while (a <= 4) {
    while (b <= 13) {
      x[a][b] = 0;
      b++;
    }
    b = 1;
    a++;
  }
  a = 1;
  int n;
  scanf("%d", &n);
  int m = 1;
  char S;
  int c, s;
  while (m <= n) {
    scanf("%lc", &S);
    scanf("&d", &c);
    while (a <= 4) {
      if (S == X[a]) {
        x[a][c] = 1;
      }
    }
    a = 1;
    m++;
  }
  while (a <= 4) {
    while (b <= 13) {
      if (x[a][b] == 0) {
        printf("%lc %d\n", X[a], b);
      }
      b++;
    }
    b = 1;
    a++;
  }
  a = 1;
  return 0;
}
