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