#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d\n", &n);
  char suits[n];
  char shouldBeSuits[52];
  int ranks[n];
  int shouldBeRanks[52];
  for (int i = 0; i < n; ++i) {
    if (i == n - 1)
      scanf("%c %d", &suits[i], &ranks[i]);
    else
      scanf("%c %d\n", &suits[i], &ranks[i]);
  }
  for (int j = 0; j < 52; ++j) {
    if (j / 13 == 0)
      shouldBeSuits[j] = 'S';
    else if (j / 13 == 1)
      shouldBeSuits[j] = 'H';
    else if (j / 13 == 2)
      shouldBeSuits[j] = 'C';
    else
      shouldBeSuits[j] = 'D';
    shouldBeRanks[j] = (j % 13) + 1;
  }
  for (int k = 0; k < 52; ++k) {
    for (int i = 0; i < n; ++i) {
      if (shouldBeSuits[k] == suits[i] && shouldBeRanks[k] == ranks[i]) {
        shouldBeSuits[k] = 'A';
        break;
      }
    }
  }
  printf("\n");
  for (int l = 0; l < n; ++l) {
    if (shouldBeSuits[l] != 'A')
      printf("%c %d\n", shouldBeSuits[l], shouldBeRanks[l]);
  }
  printf("\n");
  return 0;
}
