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