if __name__ == "__main__":
	cords = {
			'S': [ i+1 for i in range(13) ],
			'H': [ i+1 for i in range(13) ],
			'C': [ i+1 for i in range(13) ],
			'D': [ i+1 for i in range(13) ]
	}
	num = int(input())
	for i in range(num):
		cha, number = input().split()
		cards[cha][int(number)] = 0
	for i in ('S','H','C','D'):
		for j in range(13):
			if cards[i][j] != 0:
				print("%s %d"%(i,cords[i][j]))