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