using System;

class Cards
{
    public 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< n; i++)
        {
            string[] s = Console.ReadLine().Split();

            string mark = s[0];
            int number = int.Parse(s[1]);

            if(mark == "S")
            {
                S[number-1] = number;
            }else if (mark == "H")
            {
                H[number-1] = number;
            }else if (mark == "C")
            {
                C[number-1] = number;
            }else if(mark == "D")
            {
                D[number-1] = number;
            }
        }

        for(int i = 0; i < 13; i++)
        {
            if (S[i] != i+1)
            {
                Console.WriteLine("S {0}",i+1);
            }
        }
        for (int i = 0; i < 13; i++)
        {
            if (H[i] != i + 1)
            {
                Console.WriteLine("H {0}", i + 1);
            }
        }
        for (int i = 0; i < 13; i++)
        {
            if (C[i] != i + 1)
            {
                Console.WriteLine("C {0}", i + 1);
            }
        }
        for (int i = 0; i < 13; i++)
        {
            if (D[i] != i + 1)
            {
                Console.WriteLine("D {0}", i + 1);
            }
        }
    }

