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