n = input()
s = []
h = []
c = []
d = []

for i in range(n):
  card = raw_input().split(" ")
  card[1] = int(card[1])
  if card[0] == "S":
  	s.append(card[1])
  if card[0] == "H":
  	h.append(card[1])
  if card[0] == "C":
  	c.append(card[1])
  if card[0] == "D":
  	d.append(card[1])

def sort_list(lst):
#make a temporary file for storing data
  temp = []
  for i in range(1,14):
    if i not in lst:
	temp.append(i)
  lst = sorted(temp)
  return lst
  
check_cards(mark,lst):
	lst = sort_list(lst)
	for i in lst:
		print mark+" "+str(i)

check_cards(S,s)
check_cards(H,h)
check_cards(C,c)
check_cards(D,d)