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