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