#include <bits/stdc++.h>
int main(void) {
  char tmp[1000];
  fgets(tmp, sizeof(tmp), stdin);
  int loop = atoi(tmp);
  int spade[13] = {0};
  int heart[13] = {0};
  int dia[13] = {0};
  int club[13] = {0};
  int i;
  for (i = 0; i < loop; i++) {
    char card[10];
    fgets(card, sizeof(card), stdin);
    char mark;
    int num;
    sscanf(card, "%c%d", &mark, &num);
    switch (mark) {
      case 'S':
        spade[num - 1]++;
        break;
      case 'H':
        heart[num - 1]++;
        break;
      case 'C':
        club[num - 1]++;
        break;
      case 'D':
        dia[num - 1]++;
        break;
    }
  }
  for (i = 1; i <= 13; i++)
    if (spade[i - 1] != 1) printf("S:%d\n", i);
  for (i = 1; i <= 13; i++)
    if (heart[i - 1] != 1) printf("H:%d\n", i);
  for (i = 1; i <= 13; i++)
    if (club[i - 1] != 1) printf("C:%d\n", i);
  for (i = 1; i <= 13; i++)
    if (dia[i - 1] != 1) printf("D:%d\n", i);
  return 0;
}
