using System;

namespace Test
{
    class MainClass
    {
        const string SPADE = "S";
        const string HEART = "H";
        const string CLUB = "C";
        const string DIA = "D";
        public static void Main(string[] args)
        {
            var num = int.Parse(Console.ReadLine());
            var cards = new int[num];
            for (int i = 0; i < num; i++)
            {
                var inputs = Console.ReadLine().Split(' ');
                cards[i] = ChangeStringToCard(inputs[0], inputs[1]);
            }
            Array.Sort(cards);

            for (int i = 1; i <= 52; i++)
            {
                if (GetRank(cards[i - 1]) != (i % (13 + 1)))
                {
                    Console.WriteLine("{0} {1}", GetSuit(cards[i - 1]), GetRank(cards[i - 1]));
                }
            }
            
        }
        public static int ChangeStringToCard(string suit, string rank)
        {
            switch (suit)
            {
                case SPADE:
                    return int.Parse(rank);
                case HEART:
                    return int.Parse(rank) + 0x10;
                case CLUB:
                    return int.Parse(rank) + 0x20;
                case DIA:
                    return int.Parse(rank) + 0x40;
                default:
                    return 0;
            }
        }
        public static string GetSuit(int num)
        {
            var flag = num & 0xF0;
            switch (flag)
            {
                case 0:
                    return SPADE;
                case 0x10:
                    return HEART;
                case 0x20:
                    return CLUB;
                case 0x40:
                    return DIA;
                default:
                    return null;
            }
        }
        public static int GetRank(int num)
        {
            var flag = num & 0xF0;
            return num - flag;
        }
    }
}