n=int(raw_input())
s=[]
h=[]
c=[]
d=[]
ss=[]
hh=[]
cc=[]
dd=[]

for i in range(n):
	a=raw_input().split()
	
	if a[0]=="S":
		s.append(int(a[1]))
	elif a[0]=="H":
		h.append(int(a[1]))
	elif a[0]=="C":
		c.append(int(a[1]))
	elif a[0]=="D":
		d.append(int(a[1]))
for i in range(1,14):
	if i not in s:
		ss.append(i)
	if i not in h:
		hh.append(i)
	if i not in c:
		cc.append(i)
	if i not in d:
		dd.append(i)
for i in ss:
	print "S "+str(i)
for i in hh:
	print "H "+str(i)
for i in cc:
	print "C "+str(i)
for i in dd:
	print "D "+str(i)
