#include <iostream>
using namespace std;

int main(){
 int n,x,i,j;
 char s;
 int cards[4][13]=0;

 cin >> n;
 for(i=0;i<n;i++){
  cin >> s >> x;
  switch(s){
   case 'S' : cards[0][x-1]=1;
   case 'H' : cards[1][x-1]=1;
   case 'C' : cards[2][x-1]=1;
   case 'D' : cards[3][x-1]=1;
  }
 }

 for(i=0;i<13;i++){
  if(cards[0][i]==1)cout << "S " << i+1 << endl;
 }
 for(i=0;i<13;i++){
  if(cards[1][i]==1)cout << "H " << i+1 << endl;
 }
 for(i=0;i<13;i++){
  if(cards[2][i]==1)cout << "C " << i+1 << endl;
 }
 for(i=0;i<13;i++){
  if(cards[3][i]==1)cout << "D " << i+1 << endl;
 }

 return 0;
}