#include <bits/stdc++.h>
int main() {
  int card[4][14] = {0};
  int i, j, k;
  int num;
  char kind;
  int value;
  scanf("%d", &num);
  fflush(stdin);
  for (i = 0; i < num; i++) {
    scanf("%c %d", &kind, &value);
    fflush(stdin);
    switch (kind) {
      case 'S':
        card[0][value] = value;
        break;
      case 'H':
        card[1][value] = value;
        break;
      case 'C':
        card[2][value] = value;
        break;
      case 'D':
        card[3][value] = value;
        break;
      default:
        break;
    }
  }
  for (i = 0; i < 4; i < i++) {
    for (j = 1; j <= 13; j++) {
      switch (i) {
        case 0:
          if (j != card[i][j]) printf("%c %d\n", 'S', j);
          break;
        case 1:
          if (j != card[i][j]) printf("%c %d\n", 'H', j);
          break;
        case 2:
          if (j != card[i][j]) printf("%c %d\n", 'C', j);
          break;
        case 3:
          if (j != card[i][j]) printf("%c %d\n", 'D', j);
          break;
        default:
          break;
      }
    }
  }
  return 0;
}
