n=int(input())
cards = []
box = []
a = []
b = []
for i in range(n):
p,m=input().split()
box.append([p,int(m)])
for i in range(4):
for j in range(1,13+1):
if i == 0:
i = "S"
elif i==1:
i = "H"
elif i==2:
i = "C"
elif i==3:
i = "D"
cards.append([i,j])
count=0
for Input in box:
for card in cards:
if Input == card:
cards.remove(Input)
count+=1
for i in range(13*4-count):
print(cards[i][0],cards[i][1])