#include <bits/stdc++.h>
using namespace std;
int main() {
  int total, number, x;
  char suit;
  x = 0;
  cin >> total;
  int card[51]{};
  for (int i = 1; i <= total; ++i) {
    cin >> suit >> number;
    switch (suit) {
      case 'S':
        card[number * 4 - 4] = {1};
        break;
      case 'H':
        card[number * 4 - 3] = {1};
        break;
      case 'C':
        card[number * 4 - 2] = {1};
        break;
      case 'D':
        card[number * 4 - 1] = {1};
        break;
      default:
        break;
    }
  }
  for (int i = 0; i < 52; ++i) {
    if (card[i] == 0) {
      x = i % 4;
      switch (x) {
        case 0:
          cout << "S"
               << " " << i / 4 + 1 << endl;
          break;
        case 1:
          cout << "H"
               << " " << i / 4 + 2 << endl;
          break;
        case 2:
          cout << "C"
               << " " << i / 4 + 3 << endl;
          break;
        case 3:
          cout << "D"
               << " " << i / 4 << endl;
          break;
        default:
          break;
      }
    }
  }
  return 0;
}
