n = input()
a = []
for i in range(n):
	x,y = raw_input().split()
	z = int(y)
	if x == 'S':
		pass
	elif x == 'H':
		z += 13
	elif x == 'C':
		z += 26
	else:
		z += 39
	a.append(z)
a.sort()
b = []
for j in range(1,53):
	if j in a:
		pass
	else:
		b.append(j)
for k in range(0, int(len(b))):
	i = 0
	while True:
		if b[k] <= 13: break
		i += 1
		b[k] = b[k] - 13
	if i == 0:	print 'S %d' %b[k]
	elif i == 1:print 'H %d' %b[k]
	elif i == 2:print 'C %d' %b[k]	
	else:print 'D %d' %b[k]