#include <bits/stdc++.h>
int main(void) {
  int card[4][13] = {0}, b, c, n, i;
  char a;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf(" %c", &a);
    scanf("%d", &b);
    if (a == 'S')
      card[0][b - 1] = 1;
    else if (a == 'H')
      card[1][b - 1] = 1;
    else if (a == 'C')
      card[2][b - 1] = 1;
    else if (a == 'D')
      card[3][b - 1] = 1;
    printf("%c:%d\n", a, b);
  }
  for (int u = 0; u < 4; u++) {
    for (int g = 0; g < 13; g++) {
      printf("%d ", card[u][g]);
    }
    printf("\n");
  }
  for (i = 0; i < 13; i++) {
    if (card[0][i] == 0) printf("S %d\n", i + 1);
  }
  for (i = 0; i < 13; i++) {
    if (card[1][i] == 0) printf("H %d\n", i + 1);
  }
  for (i = 0; i < 13; i++) {
    if (card[2][i] == 0) printf("C %d\n", i + 1);
  }
  for (i = 0; i < 13; i++) {
    if (card[3][i] == 0) printf("D %d\n", i + 1);
  }
  return 0;
}
