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