#include <bits/stdc++.h>
int main() {
  int i;
  int num;
  int check[4][13] = {0};
  char mark[] = "SHCD";
  int n, j;
  scanf("%d", &num);
  char m[6];
  for (i = 0; i <= num; i++) {
    fflush(stdin);
    fgets(m, 6, stdin);
    if (('0' <= m[3]) && (m[3] <= '9')) {
      n = 10 + m[3] - '0';
    } else {
      n = m[2] - '0';
    }
    for (j = 0; j < 4; j++) {
      if (m[0] == mark[j]) break;
    }
    check[j][n - 1] = 1;
  }
  for (i = 0; i < 4; i++)
    for (j = 0; j < 13; j++) {
      if (check[i][j] == 0) printf("%c %d\n", mark[i], j + 1);
    }
  return 0;
}
