#include <stdio.h>

int main()
{
  int a;
  bool cards[4][14];
  int i,k;
  char b;
  int c;
  scanf("%d",&a);
  for(i=1;i<=a;i++)
  {
    scanf("%c %d",&b,&c);
    switch (b)
    {
      case 'S':
      cards[0][c] = 1;
      break;
      case 'H':
      cards[1][c] = 1;
      break;
      case 'C':
      cards[2][c] = 1;
      break;
      case 'D':
      cards[3][c] = 1;
      break;
    }
  }
  for(i=0;i<4;i++)
  {
    for(k=1;k<=13;k++)
    {
      if(cards[i][k]==0)
      {
        switch(i)
        case 0:
        printf("S %d\n",k);
        break;
        case 1:
        printf("H %d\n",k);
        break;
        case 2:
        printf("C %d\n",k);
        break;
        case 3:
        printf("D %d\n",k);
        break;
      }
    }
    }
    return 0;
  }