using System;

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