#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, m, p, s[14] = {1}, h[13] = {1}, c[13] = {1}, d[13] = {1};
  char u;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> u >> m;
    if (u == 'S')
      s[m] = 0;
    else if (u == 'H')
      h[m] = 0;
    else if (u == 'C')
      c[m] = 0;
    else if (u == 'D')
      d[m] = 0;
  }
  for (i = 0; i < 13; i++) {
    if (s[i] == 1) s[13] += 1;
  }
  for (i = 0; i < 13; i++) {
    if (h[i] == 1) h[13] += 1;
  }
  for (i = 0; i < 13; i++) {
    if (c[i] == 1) c[13] += 1;
  }
  for (i = 0; i < 13; i++) {
    if (d[i] == 1) d[13] += 1;
  }
  cout << 'S' << ' ' << s[13] << endl
       << 'H' << ' ' << h[13] << endl
       << 'C' << ' ' << c[13] << endl
       << 'D' << ' ' << d[13] << endl;
  return 0;
}
