#include <bits/stdc++.h>
struct card {
  char sort;
  int num;
};
int main(void) {
  int n, i, j;
  struct card trump[52];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%c %d", &trump[i].sort, &trump[i].num);
  }
  for (i = 0; i < 52 - n; i++) {
    for (j = 1; j <= 13; j++) {
      if (trump[i].num != i) {
        printf("%c %d\n", trump[i].sort, j);
      }
    }
  }
  return 0;
}
