cards={ 'S':[0]*13, 'H':[0]*13, 'C':[0]*13, 'D':[0]*13 } 

n=int(input()) 

for _ in range(n): 
	suit,val=input().split() 
	cards[suit][int(val)-1]=1 

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