#include <bits/stdc++.h>
int main() {
  struct Card {
    char Mark;
    int rank[12];
  };
  Card card[4];
  int num;
  char mark_;
  int buf, count[4];
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 12; j++) {
      card[i].rank[j] = 0;
    }
    count[i] = 0;
  }
  scanf("%d", &num);
  if (num <= 52) {
    for (int i = 0; i < num; i++) {
      scanf(" %c %d", &mark_, &buf);
      switch (mark_) {
        case 'S':
        case 's':
          card[0].Mark = mark_;
          card[0].rank[count[0]] = buf;
          count[0]++;
          break;
        case 'H':
        case 'h':
          card[1].Mark = mark_;
          card[1].rank[count[1]] = buf;
          count[1]++;
          break;
        case 'C':
        case 'c':
          card[2].Mark = mark_;
          card[2].rank[count[2]] = buf;
          count[2]++;
          break;
        case 'D':
        case 'd':
          card[3].Mark = mark_;
          card[3].rank[count[3]] = buf;
          count[3]++;
          break;
        default:
          printf("No corresponding mark\n");
          i--;
          break;
      }
    }
    for (int i = 0; i < 4; i++) {
      for (int j = 1; j <= 12; j++) {
        for (int k = 0; k < 12; k++) {
          if (j == card[i].rank[k]) {
            break;
          } else if (card[i].rank[k] == 0) {
            printf("%c %d\n", card[i].Mark, j);
            break;
          }
        }
      }
    }
  }
  return 0;
}
