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