using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine(); 

            int[,] cards = new int[4,13];
            int n = int.Parse(s1);
            for (int i = 0; i < n; i++)
            {
                string[] s2 = Console.ReadLine().Split(' ');
                string suit = s2[0];
                int hand = int.Parse(s2[1]);
                int a;
                if (suit == "S") { a = 0; }
                else if (suit == "H") { a = 1; }
                else if (suit == "C") { a = 2; }
                else { a = 3; }
                cards[a, hand] = 1;
            }
            for (int i = 1; i <= 4; i++)
            {
                for(int j = 1; j <= 13; j++)
                {
                    if(cards[i,j] == 0)
                    {
                        string suit2 = " ";
                        if (i == 0) { suit2 = "S"; }
                        else if (i == 1) { suit2 = "H"; }
                        else if (i == 2) { suit2= "C"; }
                        else { suit2 = "D"; }

                        Console.Write(suit2 + " " + j);
                    }
                }
            }
            Console.WriteLine("");
        }
    }
}