#include <bits/stdc++.h>
using namespace std;
int main() {
  int ar[26][1000];
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    char s;
    cin >> s >> a;
    switch (s) {
      case 'S': {
        ar[1][a] = 1;
        break;
      }
      case 'H': {
        ar[2][a] = 1;
        break;
      }
      case 'C': {
        ar[3][a] = 1;
        break;
      }
      case 'D': {
        ar[4][a] = 1;
        break;
      }
    }
  }
  char s;
  for (int i = 1; i < 5; i++) {
    for (int j = 1; j < 14; j++) {
      if (ar[i][j] == 0) {
        switch (i) {
          case 0:
            s = 'H';
            break;
          case 1:
            s = 'S';
            break;
          case 2:
            s = 'C';
            break;
          case 3:
            s = 'D';
            break;
        }
        cout << s << " " << j << endl;
      }
    }
  }
  return 0;
}
