using System;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        int num = int.Parse(Console.ReadLine());
        String mark = "SHCD";
        int [,] card = new int[4,13];

         
        for(int i = 0; i < num; i++){
             
            char inputgara = Console.ReadLine()[0];
            int  cardnum = int.Parse(Console.ReadLine());
             
            card[mark.IndexOf(inputgara),cardnum - 1] = 1;
             
        }
         
        for(int i = 0 ; i < 4 ; i++ ){
            for(int j = 0 ; j < 13 ; j++ ){
                if(card[i,j] != 1){
                    Console.Write( mark[i] + " " + (j+1));
                    Console.WriteLine();
                }
            }
                 
        }

    }
}