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