#include <bits/stdc++.h>
int main() {
  int n = 1;
  scanf("%d", n);
  int s = 1;
  int c = 1;
  int X[4][13];
  int m = 1;
  char S;
  int C;
  int ss;
  while (s <= 4) {
    while (c <= 13) {
      X[s][c] = 0;
    }
    c = 0;
    s++;
  }
  while (m <= n) {
    scanf("%c", &S);
    scanf("%d", &C);
    while (s <= 4) {
      if (S == 'S') {
        ss = 1;
      }
      if (S == 'H') {
        ss = 2;
      }
      if (S == 'C') {
        ss = 3;
      }
      if (S == 'D') {
        ss = 4;
      }
      X[s][c] = 1;
      c = 1;
      s++;
    }
    s = 1;
    m++;
  }
  while (s <= 4) {
    while (c <= 13) {
      if (X[s][c] == 1) {
        if (s == 1) {
          printf("S %d\n", c);
        }
        if (s == 2) {
          printf("H %d\n", c);
        }
        if (s == 3) {
          printf("C %d\n", c);
        }
        if (s == 4) {
          printf("D %d\n", c);
        }
      }
    }
    c = 0;
    s++;
  }
  return 0;
}
