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