#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int r[4][13];

for(int i=0;i<=3;i++){
 for(int j=0;j<=12;j++){
  r[i][j]=0;
 }
}

for(int k=0;k<n;k++){
string a;
int b;
cin >>a>>b;
if(a == "S"){
r[0][b]=1;
}else if(a =="H"){
r[1][b]=1;
}else if(a =="C"){
r[2][b]=1;
}else if(a =="D"){
r[3][b]=1;
}
}

for(int l=0;l<3;l++){
 for(int m=0;m<12;m++){
  if(a[l][m] == 1){
   if(l == 0){
    cout<<"S"<<m+1;
   }else if(l == 1){
    cout<<"H"<<m+1;
   }else if(l == 2){
    cout<<"C"<<m+1;
   }else if(l == 3){
    cout<<"D"<<m+1;
   }
  }
 }
}

}

   
