#include <bits/stdc++.h>
int main(void) {
  int a, abc[52], b = 1, c;
  char t;
  scanf("%d", &a);
  while (b <= a) {
    scanf("%c %d", &t, &c);
    switch (t) {
      case 'S':
        abc[c - 1] = 100;
        break;
      case 'H':
        abc[c + 12] = 100;
        break;
      case 'C':
        abc[c + 25] = 100;
        break;
      case 'D':
        abc[c + 38] = 100;
        break;
    }
    b++;
  }
  a = 0;
  while (a < 52) {
    if (abc[a] != 100) {
      switch (a / 13) {
        case 0:
          printf("S %d\n", a + 1);
          break;
        case 1:
          printf("H %d\n", a % 13 + 1);
          break;
        case 2:
          printf("C %d\n", a % 13 + 1);
          break;
        case 3:
          printf("D %d\n", a % 13 + 1);
          break;
      }
    }
    a++;
  }
  return 0;
}
