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