#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int temp;
  char mak;
  int list[4][n];
  for (int i = 0; i < n; i++) {
    cin >> temp >> mak;
    if (mak == 'S')
      list[0][i] = temp;
    else if (mak == 'H')
      list[1][i] = temp;
    else if (mak == 'C')
      list[2][i] = temp;
    else if (mak == 'D')
      list[3][i] = temp;
  }
  int missing[4][54];
  for (int i = 0; i < 4; i++) {
    int count = 0;
    for (int j = 1; j <= 54; j++) {
      if (list[i][j] != j) {
        count += 1;
        missing[i][count] = j;
      }
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 1; j <= 54; j++) {
      if (missing[i][j] == 0) break;
      if (i == 0)
        cout << "S" << missing[i][j] << endl;
      else if (i == 1)
        cout << "H" << missing[i][j] << endl;
      else if (i == 2)
        cout << "C" << missing[i][j] << endl;
      else if (i == 3)
        cout << "D" << missing[i][j] << endl;
    }
  }
  return 0;
}
