#include <bits/stdc++.h>
using namespace std;
int main() {
  int cards[4][13] = {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13},
                      {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13},
                      {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13},
                      {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}};
  int n, rank;
  char mark;
  cin >> n;
  for (int x = 1; x <= n; x++) {
    cin >> mark >> rank;
    if (mark == 'S') {
      cards[0][rank] = 0;
    }
    if (mark == 'H') {
      cards[1][rank] = 0;
    }
    if (mark == 'C') {
      cards[2][rank] = 0;
    }
    if (mark == 'D') {
      cards[3][rank] = 0;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 1; j <= 13; j++) {
      if (cards[i][j] == 0) {
        continue;
      }
      if (i == 0) {
        cout << 'S' << " " << j << endl;
      }
      if (i == 1) {
        cout << 'H' << " " << j << endl;
      }
      if (i == 2) {
        cout << 'C' << " " << j << endl;
      }
      if (i == 3) {
        cout << 'D' << " " << j << endl;
      }
    }
  }
  return 0;
}
