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