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