#include<cstdio>
using namespace std;
int main(){
   int S[13],H[13],C[13],D[13];
   for(int i=0;i<13;i++){
     S[i]=-1;
     H[i]=-1;
     C[i]=-1;
     D[i]=-1;
   }
   int num;
   scanf("%d",&num);
   int n;
   char m;
   for (int j=0;j<num;j++){
    scanf("%c %d",&m,&n);
    if (m=='S'){
        S[n]=1;
    }
    else if (m=='H'){
        H[n]=1;
    }
    else if (m=='C'){
        C[n]=1;
    }
    else if (m=='D'){
        D[n]=1;
    }
   }
   for (int i=0;i<4;i++){
       for(int j=0;j<13;j++){
           if(i==0){
               if(S[j]==-1){
                   printf("S");
                   printf(" ");
                   printf("%d\n",j+1);
               }
           }
           else if(i==1){
                   printf("H");
                   printf(" ");
                   printf("%d\n",j+1);
               }
           }
           else if(i==2){
               if(C[j]==-1){
                   printf("C");
                   printf(" ");
                   printf("%d\n",j+1);
               }
           }
           else if(i==3){
                   printf("D");
                   printf(" ");
                   printf("%d\n",j+1);
               }
           }
       }
   }
   printf("\n");
}




