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

namespace Prac
{
    public class Cards
    {
        public int n { get; private set; }
        public string suit { get; private set; }
        public Cards(String suit, int n)
        {
            this.suit = suit;
            this.n = n;
        }
        public String ToString()
        {
            return suit + " " + n.ToString();
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var cards = new Dictionary<Cards,bool>();
            for (var i = 0; i < 52; i++)
            {
                switch (i / 13)
                {
                    case 0:
                        cards.Add(new Cards("S", i+1), false);
                        break;
                    case 1:
                        cards.Add(new Cards("H", (i%13)+1), false);
                        break;
                    case 2:
                        cards.Add(new Cards("C", (i % 13) + 1), false);
                        break;
                    case 3:
                        cards.Add(new Cards("D", (i % 13) + 1), false);
                        break;
                }
            }
            var temp = new string[2];
            for (var i = 0; i < n; i++)
            {
                temp = Console.ReadLine().Split(' ');
                cards[new Cards(temp[0], int.Parse(temp[1]))] = true;
            }
            foreach (var c in cards)
            {
                if (c.Value == false)
                {
                    Console.WriteLine(c.Key.ToString());
                }
            }


        }
    }
}