#include <bits/stdc++.h>
int main() {
  int i, j, k, num = 0, num1 = 0, n, cards[4][13];
  char s;
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      cards[i][j] = 0;
    }
  }
  scanf("%d\n", &n);
  for (i = 0; i < n - 1; i++) {
    scanf("%c %d\n", &s, &num);
    switch (s) {
      case 'S':
        j = 0;
        break;
      case 'H':
        j = 1;
        break;
      case 'C':
        j = 2;
        break;
      case 'D':
        j = 3;
        break;
      default:
        break;
    }
    cards[j][num - 1] = 1;
  }
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      switch (i) {
        case 0:
          s = 'S';
          break;
        case 1:
          s = 'H';
          break;
        case 2:
          s = 'C';
          break;
        case 3:
          s = 'D';
          break;
        default:
          break;
      }
      if (cards[i][j] == 0) {
        printf("%c %d\n", s, j + 1);
      }
    }
  }
}
