#!/usr/bin/env ruby

card = [];spade =[];heart =[];clover = [];dia = []

number = gets.to_i
0.upto(number - 1) do |index|
    card = gets.split
    case card[0]
    when "S" then
        spade << card[1].to_i
    when "H" then
        heart << card[1].to_i
    when "C" then
        clover << card[1].to_i
    when "D" then
        dia << card[1].to_i
    end
end
spade.sort;heart.sort;clover.sort;dia.sort

1.upto(13) do |number|
    if !spade.include?(number) then
        puts "S #{number}"
    end
end

1.upto(13) do |number|
    if !heart.include?(number) then
        puts "H #{number}"
    end
end

1.upto(13) do |number|
    if !clover.include?(number) then
        puts "C #{number}"
    end
end

1.upto(13) do |number|
    if !dia.include?(number) then
        puts "D #{number}"
    end
end
