#include < stdio.h >
#include<iostream>
using namespace std;

int main() {
	int N, a, n[10][100];
	char c;

	cin >> N;

	for (int i = 0; i < N; i++) {
		cin >> c >> a;

		if (c == 'S')
			n[0][a] = a;

		else if (c == 'H')
			n[1][a] = a;

		else if (c == 'C')
			n[2][a] = a;

		else if(c=='D')
			n[3][a] = a;
	}

	for (int i = 1; i <= 13; i++) {
		if (n[0][i]!= i)
			cout << 'S' << ' ' << i << endl;

		if (n[1][i] != i)
			cout << 'H' << ' ' << i << endl;

		if (n[2][i] != i)
			cout << 'C' << ' ' << i << endl;

		if (n[3][i] !=i);
		    cout << 'D' << ' ' << i << endl;
	}
	return 0;
}