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