#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  bool a[4][13];
  cin >> n;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      a[i][j] = false;
    }
  }
  for (int i = 0; i < n; i++) {
    int x, y;
    char c;
    cin >> c >> y;
    switch (c) {
      case 'S':
        x = 0;
        break;
      case 'H':
        x = 1;
        break;
      case 'C':
        x = 2;
        break;
      case 'D':
        x = 3;
        break;
    }
    a[x][y] = true;
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (!a[i][j]) {
        char c;
        switch (i) {
          case 0:
            c = 'S';
            break;
          case 1:
            c = 'H';
            break;
          case 2:
            c = 'C';
            break;
          case 3:
            c = 'D';
            break;
        }
        cout << c << " " << j << endl;
      }
    }
  }
}
