#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, g, l, m, p, q, h = 0, i = 0, j = 0, k = 0;
  char o;
  int S[13], H[13], C[13], D[13];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> o >> g;
    switch (o) {
      case 'S':
        S[h] = g;
        h++;
      case 'H':
        H[i] = g;
        i++;
      case 'C':
        C[j] = g;
        j++;
      case 'D':
        D[k] = g;
        k++;
    }
  }
  if (S[13] == 0) {
    for (int x = 1; x <= 13; x++) {
      for (int i = 0; i < h; i++) {
        if (S[i] == x) {
          l = 1;
          break;
        }
      }
      if (l == 0) {
        cout << "S"
             << " " << x << endl;
      }
      l = 0;
    }
  }
  if (H[13] == 0) {
    for (int x = 1; x <= 13; x++) {
      for (int i = 0; i < h; i++) {
        if (H[i] == x) {
          m = 1;
          break;
        }
      }
      if (m == 0) {
        cout << "H"
             << " " << x << endl;
      }
      m = 0;
    }
  }
  if (C[13] == 0) {
    for (int x = 1; x <= 13; x++) {
      for (int i = 0; i < h; i++) {
        if (C[i] == x) {
          p = 1;
          break;
        }
      }
      if (p == 0) {
        cout << "C"
             << " " << x << endl;
        ;
      }
      p = 0;
    }
  }
  if (D[13] == 0) {
    for (int x = 1; x <= 13; x++) {
      for (int i = 0; i < h; i++) {
        if (D[i] == x) {
          q = 1;
          break;
        }
      }
      if (q == 0) {
        cout << "D"
             << " " << x << endl;
        ;
      }
      q = 0;
    }
  }
}
