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