cards = [[0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0]]
suit_dic = {'S':0, 'H':1, 'C':2, 'D':3}
suits_list = ['S', 'H', 'C', 'D']
n = input()
while (n>0):
	n -= 1
	suit, number = raw_input().split()
	cards[suit_dic.get(suit)][int(number) - 1] = 1
for i in range(0, 4):
	for j in range(0, 13):
		if cards[i][j] == 0:
			print suits_list[i], j+1

		