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