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