#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;

int main()
{
	int count;
	cin >> count;

	bool spade[13] = { false };
	bool hart[13] = { false };
	bool club[13] = { false };
	bool diamond[13] = { false };


	for (int i = 0; i < count; i++)
	{
		string mark;
		int no;

		cin >> mark >> no;
		int no_minus = no - 1;
		
		if (mark == "S") spade[no_minus] = true;
		if (mark == "H") hart[no_minus] = true;
		if (mark == "C") club[no_minus] = true;
		if (mark == "D") diamond[no_minus] = true;
	}
	for (int i = 0; i < 13; i++)
	{
		if (!spade[i]) cout << "S " << i + 1 << endl;
	}
	for (int i = 0; i < 13; i++)
	{
		if (!hart[i]) cout << "H " << i + 1 << endl;
	}
	for (int i = 0; i < 13; i++)
	{
		if (!club[i]) cout << "C " << i + 1 << endl;
	}
	for (int i = 0; i < 13; i++)
	{
		if (!diamond[i]) cout << "D " << i + 1 << endl;
	}
}
