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