cards = {

"S" : [0 for i in range(13)],
"H" : [0 for i in range(13)],
"D" : [0 for i in range(13)],
"C" : [0 for i in range(13)]
}

n = int(input())
for i in range(n):
	a,b = input().split()
	cards[a][int(b)-1] = 1

for a in ("S","H","D","C"):
	for b in range(13):
		if cards[a][b] == 0:
			print(a,b+1)