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

namespace LogicSummoner
{
    class Program
    {
        class Tramp
        {
            public char Mark { get; set; }
            public int Number { get; set; }
            public int Rank
            {
                get
                {
                    switch (Mark)
                    {
                        case 'S':
                            return 0;
                        case 'H':
                            return 1;
                        case 'C':
                            return 2;
                        case 'D':
                            return 3;
                        default:
                            return 4;
                    }
                }
            }
            public Tramp(char mark, int number)
            {
                Mark = mark;
                Number = number;
            }
            public override bool Equals(object obj)
            {
                if (obj == null)
                {
                    return false;
                }
                var c = obj as Tramp;
                if (c == null)
                {
                    return false;
                }
                return c.Mark == Mark && c.Number == Number;
            }
            public override int GetHashCode()
            {
                return ToString().GetHashCode();
            }
            public override string ToString()
            {
                return string.Format("{0} {1}", Mark, Number);
            }
            public static List<Tramp> Others(IEnumerable<Tramp> other)
            {
                return new[]
                {
                    Enumerable.Range(1, 13).Select(x => new Tramp('S', x)),
                    Enumerable.Range(1, 13).Select(x => new Tramp('H', x)),
                    Enumerable.Range(1, 13).Select(x => new Tramp('C', x)),
                    Enumerable.Range(1, 13).Select(x => new Tramp('D', x)),
                }
                .SelectMany(x => x)
                .Except(other)
                .ToList();
            }
        }

        static void Main(string[] args)
        {
            var N = GetNumber();

            var list = Enumerable.Range(0, N)
                .Select(x => GetStrings())
                .Select(xs => new Tramp(xs[0][0], int.Parse(xs[1])))
                .ToList();

            var not = Tramp.Others(list);
            foreach (var n in not)
            {
                System.Console.WriteLine(n.ToString());
            }
        }

        //static StreamReader Console = new StreamReader("input.txt");

        static int GetNumber()
        {
            return int.Parse(Console.ReadLine().Trim());
        }

        static double GetDounble()
        {
            return double.Parse(Console.ReadLine().Trim());
        }

        static int[] GetNumbersInt(int n = 0)
        {
            return Console.ReadLine().Trim().Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray();
        }

        static long[] GetNumbersLong(int n = 0)
        {
            return Console.ReadLine().Trim().Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries).Select(x => long.Parse(x)).ToArray();
        }

        static double[] GetNumbersDouble(int n = 0)
        {
            return Console.ReadLine().Trim().Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries).Select(x => double.Parse(x)).ToArray();
        }

        static string[] GetStrings(int n = 0)
        {
            return Console.ReadLine().Trim().Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries).ToArray();
        }
    }
}

Measured memory_bytes: 10320