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