#include <bits/stdc++.h>
using namespace std;
struct mn {
  char mark;
  int num;
  int tf;
};
int main() {
  struct mn set[52];
  for (int i = 0; i <= 52; i++) {
    if (i / 13 == 0) {
      set[i].mark = 'S';
    } else if (i / 13 == 1) {
      set[i].mark = 'H';
    } else if (i / 13 == 2) {
      set[i].mark = 'C';
    } else if (i / 13 == 3) {
      set[i].mark = 'D';
    }
    set[i].num = (i + 1) % 13;
    set[i].tf = 1;
  }
  int count;
  cin >> count;
  char mark;
  int number;
  for (int i = 0; i < count; i++) {
    cin >> mark >> number;
    for (int i = 0; i < 52; i++) {
      if (set[i].mark == mark && set[i].num == number) {
        set[i].tf = 0;
      }
    }
  }
  for (int i = 0; i < 52; i++) {
    if (set[i].tf == 1) {
      cout << set[i].mark << ' ' << set[i].num << endl;
    }
  }
  return 0;
}
