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