arr = Array.new(4){Array.new(13)}

for i in 0...3
for j in 1...13
 arr[i][j - 1] = 1
end
end

n = gets.to_i

for i in 0...n
suit, r =  gets.split
rank = r.to_i

if suit == "S"
 arr[0][rank-1] = nill
elsif suit == "H"
 arr[1][rank-1] = nill
elsif suit == "C"
 arr[2][rank-1] = nill
elsif suit == "D"
 arr[3][rank-1] = nill
end
end

su = ["S", "H", "C", "D"]

for i in 0...3
 for j in 1...13
if arr[i][j-1] != nill
 puts su[i] + " " + j.to_s
end
end
end

 


