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