#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, y, card[4][13];
  char x;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    cin >> y;
    if (x == 'S') {
      card[0][y - 1] = y;
    }
    if (x == 'H') {
      card[1][y - 1] = y;
    }
    if (x == 'C') {
      card[2][y - 1] = y;
    }
    if (x == 'D') {
      card[3][y - 1] = y;
    }
  }
  for (int i2 = 0; i2 < 52; i2++) {
    if (card[i2 / 13][i2 % 13] != (i2 + 1) % 13) {
      if (i2 / 13 == 0) {
        cout << "S " << i2 % 13 + 1 << endl;
      }
      if (i2 / 13 == 1) {
        cout << "H " << i2 % 13 + 1 << endl;
      }
      if (i2 / 13 == 2) {
        cout << "C " << i2 % 13 + 1 << endl;
      }
      if (i2 / 13 == 3) {
        cout << "D " << i2 % 13 + 1 << endl;
      }
    }
  }
  return 0;
}
