#include <bits/stdc++.h>
int main(void) {
  int n, i, j;
  int symbol = 0;
  int number = 0;
  int ALL[52];
  int cards[52];
  for (i = 0; i < 52; i++) {
    ALL[i] = 1;
  }
  scanf("%d", &n);
  for (j = 0; j < n; j++) {
    scanf("%c %d", &symbol, &number);
    switch (symbol) {
      case 'S':
        symbol == 0;
        break;
      case 'H':
        symbol == 1;
        break;
      case 'C':
        symbol == 2;
        break;
      case 'D':
        symbol == 3;
        break;
    }
    cards[j] = symbol * 13 + number - 1;
  }
  while (1) {
    if (i == j) {
      continue;
    } else {
      if (j <= 12) {
        putchar('S');
        printf(" %d\n", number);
      } else if (13 <= j <= 25) {
        putchar('H');
        printf(" %d\n", number);
      } else if (26 <= j <= 38) {
        putchar('C');
        printf(" %d\n", number);
      } else if (39 <= j <= 51) {
        putchar('D');
        printf(" %d\n", number);
      }
    }
    i++;
    j++;
  }
  return (0);
}
