#include <bits/stdc++.h>
using namespace std;
int main() {
  int card[4][13];
  int i, j;
  for (i = 0; i < 4; i++) {
    for (j = 0; j = 13; j++) {
      card[i][j] = j + 1;
    }
  }
  int n;
  cin >> n;
  char x;
  int y;
  int k;
  for (k = 0; k < n; k++) {
    cin >> x >> y;
    for (j = 0; i < 13; j++) {
      if (x == 'S' && y == j + 1) card[0][j] = 0;
      if (x == 'H' && y == j + 1) card[1][j] = 0;
      if (x == 'C' && y == j + 1) card[2][j] = 0;
      if (x == 'D' && y == j + 1) card[3][j] = 0;
    }
  }
  for (i = 0; i < 4; i++) {
    for (j = 0; i < 13; j++) {
      if (card[i][j] == 0) continue;
      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;
    }
  }
  return 0;
}
