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