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