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