#include <iostream>
#include <cstring>
using namespace std;

int main(){
	int a, d;
	char b;
	bool c[4][14];
	for(int i=0 ;i<4; i++){
		for(int j=0 ;j<14; j++){
			c[i][j]=0;
		}
	}
	cin >> a;
	for(int k=0 ;k<a; k++){
		cin >> b >> d;
		if(b=='S'){
			c[0][d]=1;
		}else if(b=='H'){
			c[1][d]=1;
		}else if(b=='C'){
			c[2][d]=1;
		}else if(b=='D'){
			c[3][d]=1;
		}
	}
	for(int m=0 ;m<4; m++){
		for(int n=1 ;n<14; n++){
			if(c[m][n]==1){
				continue;
			}
			if(c[m][n]==0){
				if(m==0){
					cout <<"S" << " " << n << endl; 
				}else if(m==1){
					cout << "H" << " " << n << endl;
				}else if(m==2){
					cout << "C" << " " << n << endl;
				}else if(m==3){
					cout << "D" << " " << n << endl;
				}
			}	
		}
	}
	return 0;