#include<stdio.h>

int main(){
 int n,i,j,X[4][13],B;
 char A;
 for(i=0;i<=3;i++){
  for(j=0;j<=12;j++){
   X[i][j]=1;}}
 scanf("%d",&n);
 for(i=1;i<=n;i++){
  scanf("%c %d",&A,&B);
  if(A=='S'){
   X[0][B]=0;}
  if(A=='H'){
   X[1][B]=0;}
  if(A=='C'){
   X[2][B]=0;}
  if(A=='D'){
   X[3][B]=0;}}
 for(i=0;i<=3;i++){
  for(j=0;j<=12;j++){
   if(X[i][j]=1){
    if(i==0){
     printf("S %d\n",j)}
    if(i==1){
     printf("H %d\n",j)}
    if(i==2){
     printf("C %d\n",j)}
    if(i==3){
     printf("D %d\n",j)}}}}
 return 0;}