#include <iostream>
using namespace std;

int main()
{

	int n;
	//s 0 h 1 c 2 d 3
	bool card[4][52];
	cin >> n;
	char str;
	int number;
	for(int i = 0 ; i < 4; i++)
	{
		for(int j = 0; j < 52 ; j++)
		{
			card[i][j] = false;
		}
	}
	for(int i = 0 ; i < n ; i++)
	{
		cin >> str >> number;
		if(card == "S")
		{
			card[0][number] = true;
		}else if(card == "H")
		{
			card[1][number] = true;
		}else if(card == "C")
		{
			card[2][number] = true;
			
		}else if(card == "D")
		{
			card[3][number] = true;
		}
	}
		for(int i = 0 ; i < 4; i++)
	{
		for(int j = 0; j < 52 ; j++)
		{
			if(card[i][j] == false)
			{
				if(i == 0)
				{
					cout << "S" << " "<< j << endl;
				}else if(i == 1)
				{
					cout << "H" << " "<< j << endl;
				}else if(i == 2)
				{
					cout << "C" << " "<< j << endl;
				}else if(i == 3)
				{
					cout << "D" << " "<< j << endl;
				}
			}
		}
	}
	return 0;
}
