#include<iostream>
using namespace std;

int main(){

	//初期化
	int n, x;
	char c;
	bool cards[4][13];

	for(int i = 0; i < 4; i++){
		for(int j = 0; j < 13; j++){
			cards[i][j] == false;
		}
	}

	//入力
	cin >> n;

	for(int i = 0; i < n; i++){

		cin >> c >> x;

		if(c == 'S') cards[0][x] == true;
		else if(c == 'H') cards[1][x] = true;
		else if(c == 'C') cards[2][x] = true;
		else if(c == 'D') cards[3][x] = true
	}
	

	//表示
	for(int i = 0; i < 4; i++){
		for(int j = 0; j < 13; j++){
			if(cards[i][j] == false){
				if(i == 0) cout << 'S' << " " << j + 1 << endl;
				else if(i == 1) cout << 'H' << " " << j + 1 << endl;
				else if(i == 2) cout << 'C' << " " << j + 1 << endl;
				else if(i == 3) cout << 'D' << " " << j + 1 << endl;
			}	
							
		}
	}

	return 0;

}
