using System;

public class Test
{
	static public void Main( )
	{
		const int S = 0;
		const int H = 1;
		const int C = 2;
		const int D = 3;		
		int n = int.Parse( Console.ReadLine() );
		int[,] shcd = new int[4, 13] {
			{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
			{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
			{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
			{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },};
		for( int i=0; i<n; i++ ) {
			string[] strs = Console.ReadLine().Split( ' ' );
			int val = 0;
			switch( strs[0] ) {
				case "S":val = S;
					break;
				case "H":val = H;
					break;
				case "C":val = C;
					break;
				case "D":val = D;
					break;
			}
			shcd[ val, int.Parse( strs[1] )-1 ] = 1;
		}
		for( int i=0; i<4; i++ ) {
			for( int j=0; j<13; j++ ) {
				if( 0 == shcd[S,j] ) {
					Console.WriteLine( "S "+(j+1) );
				} else if( 0 == shcd[H,j] ) {
					Console.WriteLine( "H "+(j+1) );
				} else if( 0 == shcd[C,j] ) {
					Console.WriteLine( "C "+(j+1) );
				} else if( 0 == shcd[D,j] ) {
					Console.WriteLine( "D "+(j+1) );
				}
			}
		}
	}
}