using System;
using System.Linq;

namespace ITP1_6_B_Finding_Missing_Cards
{
    class Program
    {
        static void Main(string[] args)
        {
            var cards = new[] { 'S', 'H', 'C', 'D' }.SelectMany( _ => Enumerable.Range( 1, 13 ), (mark, num) => Tuple.Create( mark, num ) )
                   .ToDictionary( pattern => pattern, _ => false );
            var total = int.Parse( Console.ReadLine() );
            var myCard = String.Empty;
            while ( ( myCard = Console.ReadLine() ) != null )
            {
                var pattern = myCard.Split( ' ' );
                var mark = pattern[ 0 ][ 0 ];
                var num = int.Parse( pattern[ 1 ] );
                cards[ Tuple.Create( mark, num ) ] = true;
            }
            foreach ( var card in cards.Where( c => c.Value == false ) )
            {
                Console.WriteLine( "{0} {1}", card.Key.Item1, card.Key.Item2 );
            }
        }
    }
}