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