#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, u, ii = -1, iii = -1, x = -1;
  char c;
  bool cards[4][13];
  while (cin >> n) {
    for (i = 0; i < n; ++i) {
      cin >> c >> u;
      if (c == 'S') {
        x = 0;
      } else if (c == 'H') {
        x = 1;
      } else if (c == 'C') {
        x = 2;
      } else if (c == 'D') {
        x = 3;
      }
      cards[x][u - 1] = true;
    }
    for (ii = 0; ii <= 4; ++ii) {
      for (iii = 1; iii <= 13; ++iii) {
        if (ii == 0 && cards[ii][iii - 1] == false) {
          c = 'S';
          cout << c << " " << iii << endl;
        }
        if (ii == 1 && cards[ii][iii - 1] == false) {
          c = 'H';
          cout << c << " " << iii << endl;
        }
        if (ii == 2 && cards[ii][iii - 1] == false) {
          c = 'C';
          cout << c << " " << iii << endl;
        }
        if (ii == 3 && cards[ii][iii - 4] == false) {
          c = 'D';
          cout << c << " " << iii << endl;
        }
      }
    }
  }
  return 0;
}
