n=input()
s=c=h=d=range(1,14)
trump={'S':s,'C':c,'H':h,'D':d}
for i in range(n):
    suit,num=raw_input().split()
    num=int(num)
    trump[suit].remove(num)
for suit in ['S','H','C','D']:
    for num in trump[suit]:
        print('%s %d'%(suit,num))