#include <bits/stdc++.h>
int main() {
  int a = 3, b = 13, c, d, e, f, g, kado[4][14];
  char A, B, C;
  for (b = 0; b < 4; b++) {
    for (a = 1; a < 14; a++) {
      kado[b][a] = 1;
    }
  }
  scanf("%d", &a);
  for (b = 1; b <= a; b++) {
    scanf("%c %d", &A, &c);
    switch (A) {
      case 'S':
        kado[0][c] = 0;
        break;
      case 'H':
        kado[1][c] = 0;
        break;
      case 'C':
        kado[2][c] = 0;
        break;
      case 'D':
        kado[3][c] = 0;
        break;
    }
    for (b = 0; b < 4; b++) {
      for (a = 1; a < 14; a++) {
        if (kado[b][a]) {
          switch (b) {
            case 0:
              printf("S %d\n", a);
              break;
            case 1:
              printf("H %d\n", a);
              break;
            case 2:
              printf("C %d\n", a);
              break;
            case 3:
              printf("D %d\n", a);
              break;
          }
        }
      }
    }
  }
  return 0;
}
