#include<iostream>
using namespace std;

int main(){
 int n,i,j;
 char a;
 int cards[4][14]={};
 cin >> n;
 for(int k=1;k<=n;++k){
  cin >> a >> j;
  if(a=="S") i=0;
  else if(a=="H") i=1;
  else if(a=="C") i=2;
  else i=3;

  cards[i][j]=1;
 }
 for(i=0;i<=3;++i){
  for(j=1;j<=13;++j){
   if(cards[i][j]==0){
    cout << i << " " << j;
   }
  }
 }
 cout << endl;
 return 0;
}