#include <stdio.h>

int main(void)
{
  int n = 0;
  int num;
  int class;
  int card[4][13]={{1,2,3,4,5,6,7,8,9,10,11,12,13},{1,2,3,4,5,6,7,8,9,10,11,12,13},{1,2,3,4,5,6,7,8,9,10,11,12,13},{1,2,3,4,5,6,7,8,9,10,11,12,13}};
  int i, j;

  
  scanf("%d", &n);

  for(i = 0; i < n; i++){
    scanf("%c %d", &class, &num);

    if(class == 'S')
      j = 0;
    if(class == 'H')
      j = 1;
    if(class == 'C')
      j = 2;
    if(class == 'D')
      j = 3;

    card[j][num - 1] = 0;
  }

  for(i = 0; i < 13; i++)
    if(card[0][i] != 0)
      printf("S %d\n", card[0][i]);
  for(i = 0; i < 13; i++)
    if(card[1][i] != 0)
      printf("H %d\n", card[1][i]);
  for(i = 0; i < 13; i++)
    if(card[2][i] != 0)
      printf("C %d\n", card[2][i]);
  for(i = 0; i < 13; i++)
    if(card[3][i] != 0)
      printf("D %d\n", card[3][i]);
  
  return 0;
}