#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, n;
  cin >> n;
  char m;
  int card[5][14];
  for (int i = 1; i <= 4; i++) {
    for (int j = 0; j < 13; j++) card[i][j] = 0;
  }
  for (int i = 1; i < n; i++) {
    cin >> m >> a;
    if (m == 'S') {
      card[1][a] == 1;
    } else if (m == 'H') {
      card[2][a] == 1;
    } else if (m == 'D') {
      card[3][a] == 1;
    } else if (m == 'C') {
      card[4][a] == 1;
    }
  }
  for (int i = 1; i <= 13; i++) {
    if (card[1][i] != 1) {
      cout << "S"
           << " " << i << endl;
    } else if (card[2][i] != 1) {
      cout << "H"
           << " " << i << endl;
    } else if (card[3][i] != 1) {
      cout << "D"
           << " " << i << endl;
    } else if (card[4][i] != 1) {
      cout << "C"
           << " " << i << endl;
    }
  }
  return 0;
}
