#include <iostream>
using namespace std;
 
int main() {
	int n,rank;
	char mark;
	cin >> n ;
	int cards[5][14];
	for(int i = 0; i < n ; i++){
		cin >> mark >> rank;
		if(mark == "S")cards[1][rank]=1;
		else if(mark == "H")cards[1][rank]=1;
		else if(mark == "C")cards[1][rank]=1;
		else if(mark = ="D")cards[1][rank]=1;
	//????´???????
	for(int k = 1; k <= 4; k++){
		for(int j = 1; j <= 13 ; j++){
			if(k==1 && cards[1][j]==1)cout << "S" << " " << j << endl;
			if(k==2 && cards[1][j]==1)cout << "H" << " " << j << endl;
			if(k==3 && cards[1][j]==1)cout << "C" << " " << j << endl;
			if(k==4 && cards[1][j]==1)cout << "D" << " " << j << endl;
		}
 
	}
 
	}
	return 0;
}