S = [0,0,0,0,0,0,0,0,0,0,0,0,0,0]
H = [0,0,0,0,0,0,0,0,0,0,0,0,0,0]
C = [0,0,0,0,0,0,0,0,0,0,0,0,0,0]
D = [0,0,0,0,0,0,0,0,0,0,0,0,0,0]
l=int(input())
for i in range(l):
	a,b = input().split()
	b = int(b) 
	if   a == 'S':
			S[b] = 1
	elif a == 'H' :
			H[b] = 1
	elif a == 'C':
			C[b] = 1
	elif a == 'D':
			D[b] = 1
for k in range(1,13):
	if not S[k] :
		print('S',k)
for k in range(1,13):
	if not H[k] :
		print('H',k)
for k in range(1,13):
	if not C[k] :
		print('C',k)
for k in range(1,13):
	if not D[k] :
		print('D',k)
