#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, rank;
  int C[4][13];
  char art;
  cin >> n;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      C[i][j] = 0;
    }
  }
  for (int i = 0; i < n; i++) {
    cin >> art >> rank;
    if (art == 'S') {
      C[0][rank - 1] = 1;
    } else if (art == 'H') {
      C[1][rank - 1] = 1;
    } else if (art == 'C') {
      C[2][rank - 1] = 1;
    } else {
      C[3][rank - 1];
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (C[i][j] == 0) {
        switch (i) {
          case 0:
            cout << 'S' << " " << j + 1 << endl;
          case 1:
            cout << 'H' << " " << j + 1 << endl;
          case 2:
            cout << 'C' << " " << j + 1 << endl;
          case 3:
            cout << 'D' << " " << j + 1 << endl;
        }
      }
    }
  }
  return 0;
}
