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