#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int i = 0;
  int cards[4][13];
  int j, k, l, m;
  for (j = 0; j < 4; j++) {
    for (k = 0; k < 13; k++) {
      cards[j][k] = 0;
    }
  }
  for (i = 0; i < n; i++) {
    string mark;
    int number;
    cin >> mark >> number;
    if (mark == "S") {
      cards[0][number] = 1;
    } else if (mark == "H") {
      cards[1][number] = 1;
    } else if (mark == "C") {
      cards[2][number] = 1;
    } else {
      cards[3][number] = 1;
    }
  }
  for (l = 0; l < 4; l++) {
    for (m = 0; m < 13; m++) {
      if (cards[l][m] == 0) {
        if (l == 0) {
          cout << "S"
               << " " << m + 1 << endl;
        } else if (l == 1) {
          cout << "H"
               << " " << m + 1 << endl;
        } else if (l == 2) {
          cout << "C"
               << " " << m + 1 << endl;
        } else if (l == 3) {
          cout << "D"
               << " " << m + 1 << endl;
        }
      }
    }
  }
  return 0;
}
