using System;

namespace Test
{
    class MainClass
    {
        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);
            int index = 0;
            for (int i = 1; i <= 52; i++)
            {
                if (cards[index] != i)
                {
                    if (i <= 13) Console.WriteLine("S {0}", i);
                    else if ((13 < i) && (i <= (13 * 2))) Console.WriteLine("H {0}", i - 13);
                    else if ((13 < i) && (i <= (13 * 3))) Console.WriteLine("C {0}", i - 13 * 2);
                    else if ((13 < i) && (i <= (13 * 4))) Console.WriteLine("D {0}", i - 13 * 3);
                    index--;
                }
                index++;
            }
            
        }
        public static int ChangeStringToCard(string suit, string rank)
        {
            switch (suit)
            {
                case "S":
                    return int.Parse(rank);
                case "H":
                    return int.Parse(rank) + 13;
                case "C":
                    return int.Parse(rank) + 13*2;
                case "D":
                    return int.Parse(rank) + 13*3;
                default:
                    throw new Exception();
            }
        }
    }
}