#include<stdio.h>

int main(){

int n[4][13],j,i,a,output;
for(i = 0; i < 4 ; i++){
  for(j = 0; j < 13; j++){
  n[i][j] = j+1;
  }
}
  
scanf("%d",&a);
  int c[a],k;
  char b[a];
for(k = 0; k < a; k++){
  scanf("%c %d",&b[k],&c[k]); 
}
for(output = 0; output < 52; output++){
  for(input = 0; input < 13; input++){
    if(b[output] == 'S'&& c[input] != n[0][input]){
    printf("%c %d\n",b[k],n[0][k]);
    }else if(b[output] == 'H'&& c[input] != n[1][input]){
    printf("%c %d\n",b[k],n[1][k]);
    }else if(b[output] == 'C' && c[input] != n[2][input]){
    printf("%c %d\n",b[k],n[2][k]);
    }else if(b[output] == 'D' && c[input] != n[3][input]){
    printf("%c %d\n",b[k],n[3][k]);
    }
  }
}

return 0;
}
