#include<stdio.h>
struct card{
  char mark;
  int num;
  int check;
}
int main(void)
{
  struct card tcards[53]=
  {
    {S,1,0},{S,2,0},{S,3,0},{S,4,0},{S,5,0},{S,6,0},{S,7,0},{S,8,0},{S,9,0},{S,10,0},{S,11,0},{S,12,0},{S,13,0},
    {H,1,0},{H,2,0},{H,3,0},{H,4,0},{H,5,0},{H,6,0},{H,7,0},{H,8,0},{H,9,0},{H,10,0},{H,11,0},{H,12,0},{H,13,0},
    {C,1,0},{C,2,0},{C,3,0},{C,4,0},{C,5,0},{C,6,0},{C,7,0},{C,8,0},{C,9,0},{C,10,0},{C,11,0},{C,12,0},{C,13,0},
    {D,1,0},{D,2,0},{D,3,0},{D,4,0},{D,5,0},{D,6,0},{D,7,0},{D,8,0},{D,9,0},{D,10,0},{D,11,0},{D,12,0},{D,13,0}
  }
  struct card fcards[53];
	int i,n;
	scanf("%d",&n);
	for(i = 0;i < n;i++){
		scanf("%c %d",&fcards.mark[i],&fcards.num[i]);
	}
	for(i = 0;i < n;i++){
    if(fcards.mark[i] == 'S'){
      tcards[fcards.num[i]].check ++;
    }
    if(fcards.mark[i] == 'H'){
      tcards[fcards.num[i]+13].check ++;
    }
    if(fcards.mark[i] == 'C'){
      tcards[fcards.num[i]+26].check ++;
    }
    if(fcards.mark[i] == 'D'){
      tcards[fcards.num[i]+39].check ++;
    }
  }
  for(i = 0;i < n;i++){
    if(tcards[i].check == 0){
      printf("%c %d\n",tcards[i].mark,tcards[i].num)
    }
  }
	return 0;
}