dic = {}
mark = ['S', 'H', 'C', 'D']
rank = [k for k in range(1, 14)]

for i in mark:
	for j in rank:
		dic[(i,j)] = 0

n = int(raw_input())
for k in range(n):
	p,r = raw_input().split()
	r = int(r)
	dic [(p,r)] += 1

for i in mark:
	for j in rank:
		if dic[(i,j)] == 0:
			print '%s %d' % (i,j)