using System;

class Program
{
    static void Main()
    {
        int c = int.Parse(Console.ReadLine());
        string[] inStr;
        
        string wk = "";
        for (int i = 1; i <= 13; i++) { wk = wk + i.ToString() + " "; }
        
        string[] t = new String[4];
        t[0] = wk;
        t[1] = wk;
        t[2] = wk;
        t[3] = wk;
        
        for (int i = 0; i < c; i++)
        {
            inStr = Console.ReadLine().Split(' ');
            
                 if (inStr[0] == "S") { t[0].Replace(inStr[1] + " ", ""); }
            else if (inStr[0] == "H") { t[1].Replace(inStr[1] + " ", ""); }
            else if (inStr[0] == "C") { t[2].Replace(inStr[1] + " ", ""); }
            else if (inStr[0] == "D") { t[3].Replace(inStr[1] + " ", ""); }
        }
        
        string result;
        string[] a;
        
        //結果を表示
        for (int i = 0; i < 4; i++)
        {
            if (!t[i].TrimEnd().Equals(""))
            {
                a = t[i].Split(' ');
                
                for (int j = 0; j < a.Length - 1; j++)
                {
                    if (!a[j].TrimEnd().Equals(""))
                    {
                             if (i == 0) { result = "S "; }
                        else if (i == 1) { result = "H "; }
                        else if (i == 2) { result = "C "; }
                        else if (i == 3) { result = "D "; }
                        
                        result = result + a[j].TrimEnd();
                        Console.WriteLine(result);
                    }
                }
            }
        }
    }
}
