#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  bool card[4][53];
  cin >> n;
  char str;
  int number;
  for (int i = 0; i < 4; i++) {
    for (int j = 1; j < 53; j++) {
      card[i][j] = false;
    }
  }
  for (int i = 0; i < n; i++) {
    cin >> str >> number;
    if (str == 'S') {
      card[0][number] = true;
    } else if (str == 'H') {
      card[1][number] = true;
    } else if (str == 'C') {
      card[2][number] = true;
    } else if (str == 'D') {
      card[3][number] = true;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 1; j < 53; j++) {
      if (card[i][j] == false) {
        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;
        }
      }
    }
  }
  return 0;
}
