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