#include <bits/stdc++.h>
int main() {
  char sign[]{'S', 'H', 'C', 'D'};
  bool card[13][4];
  for (int l = 0; l < 4; l++) {
    for (int m = 0; m < 13; m++) {
      card[4][13] = false;
    }
  }
  int n;
  int i_shcd;
  char shcd;
  int rank;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%c %d", &shcd, &rank);
    switch (shcd) {
      case 'S':
        i_shcd = 0;
        break;
      case 'H':
        i_shcd = 1;
        break;
      case 'C':
        i_shcd = 2;
        break;
      case 'D':
        i_shcd = 3;
        break;
    }
    card[rank - 1][i_shcd] = true;
  }
  for (int j = 0; j < 4; j++) {
    for (int k = 0; k < 13; k++) {
      if (!(card[k][j])) printf("%c %d\n", sign[j + 1], k);
    }
  }
}
