#include <bits/stdc++.h>
using namespace std;
int main() {
  int cards[4][13] = {};
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    char c;
    int a;
    cin >> c >> a;
    for (int j = 0; j = n; j++) {
      if (c == 'S') {
        cards[0][a] = 1;
      } else if (c == 'H') {
        cards[1][a] = 1;
      } else if (c == 'C') {
        cards[2][a] = 1;
      } else {
        cards[3][a] = 1;
      }
    }
    for (int k = 0; k < n; k++) {
      if (cards[0][k] = 0) {
        cout << "S " << k << endl;
      } else if (cards[1][k] = 0) {
        cout << "H " << k << endl;
      } else if (cards[2][k] = 0) {
        cout << "C " << k << endl;
      } else {
        cout << "D " << k << endl;
      }
    }
    return 0;
  }
}
