# all cards list
marks = ['S', 'H', 'C', 'D']
cards = []
for i in marks:
	for j in range(1, 14):
		cards.append([i, str(j)])

# input cards list
n = input()
in_cards = []
for i in range(n):
	in_cards.append(raw_input().split())

# comp
for i in cards:
	for j in in_cards:
		if i == j:
			cards.remove(i)
			break

# print
for i in cards:
	print i[0],i[1]