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