using System;
using System.Collections;

    class Program
    {
        static void Main()
        {
            bool[,] card = new bool[4,13];
            HashTable types = new HashTable();
            types.setKeyValue("S", 0);
            types.setKeyValue("H", 1);
            types.setKeyValue("C", 2);
            types.setKeyValue("D", 3);

            int cardnum = int.Parse(Console.ReadLine());
            for (int i = 0; i < cardnum; i++)
            {
                string[] line = Console.ReadLine().Split(' ');
                card[types.getValue(line[0]), int.Parse(line[1]) - 1] = true;
            }

            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 13; j++)
                {
                    if (!card[i, j]) Console.WriteLine(types.getKey(i) + " " + j.ToString());
                }
            }
        }
    }

    class HashTable
    {
        Hashtable keyValue = new Hashtable();
        Hashtable valueKey = new Hashtable();

        public void setKeyValue(string key, int value)
        {
            keyValue[key] = value;
            valueKey[value] = key;
        }

        public string getKey(int value)
        {
            return valueKey[value].ToString();
        }
        public int getValue(string key)
        {
            return (int)keyValue[key];
        }

    }