#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  char mark;
  char suits[4] = {'S', 'H', 'C', 'D'};
  int d[52] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
               1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
               1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
               1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
  int A[52] = {0};
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> mark >> A[i];
    if (mark == suits[0]) {
      for (int j = 0; j <= 12; j++) {
        if (A[i] == d[j]) d[j] = 0;
      }
    }
    if (mark == suits[1]) {
      for (int j = 13; j <= 25; j++) {
        if (A[i] == d[j]) d[j] = 0;
      }
    }
    if (mark == suits[2]) {
      for (int j = 26; j <= 38; j++) {
        if (A[i] == d[j]) d[j] = 0;
      }
    }
    if (mark == suits[3]) {
      for (int j = 39; j <= 51; j++) {
        if (A[i] == d[j]) d[j] = 0;
      }
    }
  }
  for (int i = 0; i < 52; i++) {
    if (d[i] != 0) {
      if (0 <= i <= 12) cout << suits[0] << d[i] << "\n";
      if (13 <= i <= 25) cout << suits[1] << d[i] << "\n";
      if (26 <= i <= 38) cout << suits[2] << d[i] << "\n";
      if (39 <= i <= 51) cout << suits[3] << d[i] << "\n";
    }
  }
  return 0;
}
