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

int main(){
  char text;
  int t[4][14],v;
  int c,d,i;
  scanf("%d",&c);
  for(i=0;i<c;i++){
    scanf("%c",&v);
    scanf("%c %d",&text,&d);
    if(text == "S"){
    t[0][d] = 1;}
    else if(text == "H"){
    t[1][d] = 1;}
    else if(text == "C"){
    t[2][d] = 1;}
    else if(text == "D"){
    t[3][d] = 1;}}

  for(i=1;i<14;i++){
    if(t[0][i] != 1){
    printf("S %d\n",i);}
  }

  for(i=1;i<14;i++){
    if(t[1][i] != 1){
    printf("H %d\n",i);}
  }

  for(i=1;i<14;i++){
    if(t[2][i] != 1){
    printf("C %d\n",i);}
  }

  for(i=1;i<14;i++){
    if(t[3][i] != 1){
    printf("D %d\n",i);}
  }
return 0;
}
