#include <bits/stdc++.h>
using namespace std;
int main() {
  int cards[4][13];
  int x, n;
  string a;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a >> x;
    if (a == "S") {
      cards[0][x] = 1;
    } else if (a == "H") {
      cards[1][x] = 1;
    } else if (a == "C") {
      cards[2][x] = 1;
    } else if (a == "D") {
      cards[3][x] = 1;
    }
  }
  for (int j = 1; j <= 13; j++) {
    if (cards[0][j] != 1) {
      cout << "S"
           << " " << j << endl;
    }
  }
  for (int k = 1; k <= 13; k++) {
    if (cards[0][k] != 1) {
      cout << "H"
           << " " << k << endl;
    }
  }
  for (int l = 1; l <= 13; l++) {
    if (cards[0][l] != 1) {
      cout << "C"
           << " " << l << endl;
    }
  }
  for (int m = 1; m <= 13; m++) {
    if (cards[0][m] != 1) {
      cout << "D"
           << " " << m << endl;
    }
  }
  return 0;
}
