using System;

class Program
{
    static void Main()
    {
            int i;
            int[] hart = new int[13];
            int[] club = new int[13];
            int[] spade = new int[13];
            int[] dia = new int[13];
            for (i = 0; i < 13; i++)
            {
                hart[i] = 0;
                club[i] = 0;
                spade[i] = 0;
                dia[i] = 0;
            }
            string len = Console.ReadLine();
            string[] mark = new string[int.Parse(len)];
            int[] number = new int[int.Parse(len)];
            for (i = 0; i < int.Parse(len); i++)
            {
                string inp = Console.ReadLine();
                string[] card = inp.Split(' ');
                mark[i] = card[0];
                number[i] = int.Parse(card[1]);
                switch (mark[i])
                {
                    case "H":
                        hart[number[i]-1] = 1;
                        break;
                    case "C":
                        club[number[i]-1] = 1;
                        break;
                    case "S":
                        spade[number[i]-1] = 1;
                        break;
                    case "D":
                        dia[number[i]-1] = 1;
                        break;
                }
            }//shcd
            for (i = 0; i < 12; i++)
            {
                if (spade[i] == 0)
                {
                    Console.WriteLine("S {0}",i + 1);
                }
            }
            for (i = 0; i < 12; i++)
            {
                if (hart[i] == 0)
                {
                    Console.WriteLine("H {0}", i + 1);
                }
            }
            for (i = 0; i < 12; i++)
            {
                if (club[i] == 0)
                {
                    Console.WriteLine("C {0}", i + 1);
                }
            }
            for (i = 0; i < 12; i++)
            {
                if (dia[i] == 0)
                {
                    Console.WriteLine("D {0}", i + 1);
                }
            }
    }
}
