#include <iostream>


using namespace std;

int main(){

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

	int n;
	cin >> n;
	char mark;
	int num;
	for (int i = 0; i < n; i++){
		cin >> mark >> num;
		if (mark == 'S'){
			cards[0][num-1] = 1;
		}
		else if (mark == 'H'){
			cards[1][num-1] = 1;
		}
		else if (mark == 'C'){
			cards[2][num-1] = 1;
		}
		else if (mark == 'D'){
			cards[3][num-1] = 1;
		}
	}

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