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