#include <bits/stdc++.h>
int main(void) {
  int ans[4][13], card[4][13], x[52], n, i, j, k;
  char m[52], dummy;
  for (i = 0; i < 52; i++) {
    x[i] = 0;
  }
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%c", &dummy);
    scanf("%c %d", &m[i], &x[i]);
  }
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      ans[i][j] = 1;
      card[i][j] = j + 1;
      printf("%d\n", card[i][j]);
    }
  }
  i = 0;
  while (x[i] != 0) {
    printf("\n\n");
    for (k = 0; k < 13; k++) {
      if (m[i] == 'S' && x[i] == card[0][k]) {
        ans[0][k] = 0;
        printf("%d\n", card[0][k]);
        break;
      } else if (m[i] == 'H' && x[i] == card[1][k]) {
        ans[1][k] = 0;
        printf("%d\n", card[1][k]);
        break;
      } else if (m[i] == 'C' && x[i] == card[2][k]) {
        ans[2][k] = 0;
        printf("%d\n", card[2][k]);
        break;
      } else if (m[i] == 'D' && x[i] == card[3][k]) {
        ans[3][k] = 0;
        printf("%d\n", card[3][k]);
        break;
      }
    }
    i++;
  }
  printf("\n\n");
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      if (ans[i][j] == 1) {
        if (i == 0)
          printf("S %d\n", card[0][j]);
        else if (i == 1)
          printf("H %d\n", card[1][j]);
        else if (i == 2)
          printf("C %d\n", card[2][j]);
        else if (i == 3)
          printf("D %d\n", card[3][j]);
      }
    }
  }
  return 0;
}
