using System;

class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());

        int[] s = new int[13];
        int[] h = new int[13];
        int[] c = new int[13];
        int[] d = new int[13];
        for(int i = 0;i < s.Length; i++)
        {
            s[i] = i + 1;
            h[i] = i + 1;
            c[i] = i + 1;
            d[i] = i + 1;
        }

        for(int i = 0; i < n; i++)
        {
            string[] str = Console.ReadLine().Split(' ');
            int x = int.Parse(str[1]);
            if (str[0] == "s")
            {
                s[x - 1] = 0;
            }else if (str[0] == "h")
            {
                h[x - 1] = 0;
            }else if(str[0] == "c")
            {
                c[x - 1] = 0;
            }else
            {
                d[x - 1] = 0;
            }
        }

        for(int i = 0;i < s.Length; i++)
        {
            if(s[i] != 0)
            {
                Console.WriteLine("S " + s[i]);
            }
        }
        for (int i = 0; i < h.Length; i++)
        {
            if (h[i] != 0)
            {
                Console.WriteLine("H " + h[i]);
            }
        }
        for (int i = 0; i < c.Length; i++)
        {
            if (c[i] != 0)
            {
                Console.WriteLine("C " + c[i]);
            }
        }
        for (int i = 0; i < d.Length; i++)
        {
            if (d[i] != 0)
            {
                Console.WriteLine("D " + d[i]);
            }
        }


    }
}