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