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