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