def array_integer(a)
	0.upto(a.count) {|x|
		a[x] = a[x].to_i
	}
	return a
end

deck = Hash.new { |h, k| h[k] = []}
["S", "H", "C", "D"].each {|suit|
	1.upto(13) {|num|
		deck[suit][num] = false
	}
}

n = STDIN.gets
n = n.to_i

1.upto(n) {|i|
	suit,num = STDIN.gets.split(" ")
	num = num.to_i
	deck[suit][num] = true
}

["S", "H", "C", "D"].each {|suit|
	1.upto(13) {|num|
		if deck[suit][num] == false then
			print suit, " ", num, "\n"
		end
	}
}

