using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine();
            int n = int.Parse(s1);
            int i;
            char suit;
            int number;
            char[] suit2 = new char[4] { 'S', 'H', 'C', 'D' };
            bool[,] cards = new bool[4, 13];
            for (i = 0; i < n; i++)
            {
                string[] s2 = Console.ReadLine().Split(' ');
                suit = char.Parse(s2[0]);
                number = int.Parse(s2[1]);
                switch (suit)
                {
                    case 'S':
                        cards[0, number - 1] = true;
                        break;
                    case 'H':
                        cards[1, number - 1] = true;
                        break;
                    case 'C':
                        cards[2, number - 1] = true;
                        break;
                    case 'D':
                        cards[3, number - 1] = true;
                        break;
                }
            }
            for (int j = 1; j < 4; i++)
            {
                for (int k = 1; k < 13; j++)
                {
                    if (!cards[i, j])
                    {
                        Console.WriteLine( "{0} {1} ", suit2[j] , i + 1);
                    }
                }
            }
        }
    }
}