using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> spadecardnum = new List<int>();
            List<int> heartcardnum = new List<int>();
            List<int> clubcardnum = new List<int>();
            List<int> diacardnum = new List<int>();

            //????????¶?????????????????????????????????????????°??????????????????
            int havecardnum =  int.Parse(Console.ReadLine());


            //????????¶??????????????????????????????????????????????????????add??????
            for(int i = 0; havecardnum > i; i++) 
            {
                string cardtype = Console.ReadLine();

               string[] havecard = cardtype.Split(' ');

                    //????????¶????????????????????????????????????????????¨???????????????add??????
                    switch (havecard[0])
                    {
                         case "S":
                                spadecardnum.Add(int.Parse(havecard[1]));
                                break;

                         case "H":
                                heartcardnum.Add(int.Parse(havecard[1]));
                                break;

                         case "C":
                                clubcardnum.Add(int.Parse(havecard[1]));
                                break;

                         case "D":
                                diacardnum.Add(int.Parse(havecard[1]));
                                break;
                    }
            }

            //??????
            LackOutPut(PrintData(spadecardnum), 1);
            LackOutPut(PrintData(heartcardnum), 2);
            LackOutPut(PrintData(clubcardnum), 3);
            LackOutPut(PrintData(diacardnum), 4);
        }

        /// <summary>
        /// ????¶???????????????????????????????
        /// </summary>
        /// <param name="list">????????¶?????????????????????????????????????????????</param>
        /// <returns></returns>
        private static List<int> PrintData(List<int> list)
        {
            List<int> result = new List<int>();
            for (int x = 1; x <= 13; x++)
            {
                if (list.Contains(x)) continue;
                result.Add(x);
            }
            return result;
        }

        /// <summary>
        /// ????¶?????????????????????????
        /// </summary>
        /// <param name="list">????¶??????????????????????????????????</param>
        /// <param name="handle">???????????????????????\????????????</param>
        private static void LackOutPut(List<int> list, int handle)
        {
            string printhandle = string.Empty;

            switch (handle)
                {
                    case 1:
                        printhandle = "S";
                        break;

                    case 2:
                        printhandle = "H";
                        break;

                    case 3:
                        printhandle = "C";
                        break;

                    case 4:
                        printhandle = "D";
                        break;
                }

            foreach(var result in list)
            {
                Console.WriteLine("{0} {1}", printhandle, result);
            }
        }
    }
}

Measured memory_bytes: 9772