#include <iostream>
using namespace std;

int main()
{
	int ar[26][1000];
	
	int n;
	cin>>n;
	for (int i =0; i < n; i++)
	{
		int a;
		char s;
		cin>>s>>a;
		switch (s)
	{
	case 'S': 
		{
			ar[1][a] = 1;
			break;
		}
		case 'H': 
		{
			ar[2][a] = 1;
			
			break;
		}
		case 'C': 
		{
			ar[3][a] = 1;
		
			break;
		}
		case 'D': 
		{
			ar[4][a] = 1;
			
			break;
		}
	}
	}
	for ( int i = 0; i < 4; i++ )
	{
		for(int j = 0; j < 13 ; j++)
		{
            if(ar[i][j]==0)
			{
                switch(i)
				{
					case 0:
					   s='H';
					  break;
					case 1:
					   s='S';
					   break;
					case 2:
					    s='C';
					  break;
					case 3:
					   s='D';
                    break;
                }
                cout<<s<<" "<<j<<endl;
            }
         }
    }
	return 0;
}