#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, num;
  bool card[4][13] = {false};
  char pattern;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> pattern >> num;
    switch (pattern) {
      case 'S':
        card[0][num] = true;
        break;
      case 'H':
        card[1][num] = true;
        break;
      case 'C':
        card[2][num] = true;
        break;
      case 'D':
        card[3][num] = true;
        break;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (card[i][j]) {
        switch (i) {
          case 0:
            cout << "S " << j << "\n";
          case 1:
            cout << "H " << j << "\n";
          case 2:
            cout << "C " << j << "\n";
          case 3:
            cout << "D " << j << "\n";
        }
      }
    }
  }
  return 0;
}
