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