n = int(input())
cards = []
patterns = ['S', 'H', 'C', 'D']
for i in range n:
	each_card = list(map(str, input().strip()))	
	each_card[1] = int(each_card[1])
	cards.append(each_card)
for p in patterns:
	for r in range(1, 13+1):
		if [p, r] in cards:
			pass
		else:
			print(" ".join(map(str, [p, r])))