using System;


class Program
{
    static void Main()
    {
        int x = int.Parse(Console.ReadLine()); //???????????????????????????????????°
        int[,] cards = new int[4, 13];

        for (int i= 0; i < x; i++)
        {
            string[] str = Console.ReadLine().Split(' ');
            string Class = str[0];
            int num = int.Parse(str[1]);
            int number = 0;
            switch (Class)
            {
                case "S": number = 0; break;
                case "H": number = 1; break;
                case "C": number = 2; break;
                case "D": number = 3; break;
            }

            cards[number, num] = 1;
        }

        //???????????§?????????????????\???

        int[,] CollectCards = new int[4, 13];

        for(int i= 0; i < cards.GetLength(0);i++)
        {
            for (int i2= 0; i2 < cards.GetLength(1);i2++)
            {
                if (CollectCards[i,i2] == cards[i,i2])
                {
                    
                    string OutClass = "";

                    switch(i)
                    {
                        case 0: OutClass = "S"; break;
                        case 1: OutClass = "H"; break;
                        case 2: OutClass = "C"; break;
                        case 3: OutClass = "D"; break;
                    }

                    Console.WriteLine("{0} {1}", OutClass, i2+1);
                }
            }
        }
    

    }


}