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