#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct Card {
    char picture;
    int number;
};

void Scan(struct Card recive[]){
    for(int i=0;i<strlen(recive);i++)
   {
       scanf("%s %d",&recive[i].picture,&recive[i].number);
    }
}

void MakeList(struct Card  list[]){
  for(int i=0;i<4;i++){
    for(int j=0;j<13;j++){
      switch(i){
        case 0: list[j].picture='H';
        list[j].number=j+1;
        break;
        case 1: list[j+13].picture='S';
        list[j+13].number=j+1;
        break;
        case 2: list[j+26].picture='D';
        list[j+26].number=j+1;
        break;
        case 3: list[j].picture='C';
        list[j+26].number=j+1;
        break;
      }
    }
  }
}

void CheckList(struct Card list[],struct Card recive[]){
  for(int i=0;i<strlen(list);i++){
    for(int j=0;j<strlen(recive);j++){
      if(list[i].picture==recive[j].picture&&list[i].number==recive[j].number){
        list[i].picture="";
        list[i].number=0;
        break;
      }
    }
  }
}

void PrintLostList(struct Card list[]){
  for(int i=0;i<strlen(list);i++){
    if(!(list[i].picture==""&&list[i].number==0)){
      printf("%c %d\n",list[i].picture,list[i].number);
    }
  }
}

int main(void)
{
    int n=0;
    scanf("%d",&n);
    struct Card inputdate[n];
    struct Card List[52];
    Scan(inputdate);
    MakeList(List);
    CheckList(List,inputdate);
    PrintLostList(List);
    return 0;
}

