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