#include <bits/stdc++.h>
using namespace std;
int main() {
  int cards[4][14] = {};
  char ch;
  int i, num;
  cin >> i;
  for (int j = 0; j < i; j++) {
    cin >> ch >> num;
    if (ch == 'S') {
      cards[0][num] = true;
    } else if (ch == 'H') {
      cards[1][num] = true;
    } else if (ch == 'C') {
      cards[2][num] = true;
    } else {
      cards[3][num] = true;
    }
  }
  for (int x = 0; x < 4; ++x) {
    for (int y = 0; y < 13; ++y) {
      if (!cards[x][y]) {
        if (x == 0) {
          cout << "S " << y << endl;
        } else if (x == 1) {
          cout << "H " << y << endl;
        } else if (x == 2) {
          cout << "C " << y << endl;
        } else {
          cout << "D " << y << endl;
        }
      }
    }
  }
}
