symboldict = {'S':0, 'H':1, 'C':2, 'D':3} 
cardlist = [[0 for i in range(13)] for j in range(4)] 

total = int(input())
for i in range(total):
    sym, num = input().split()
    cardlist[symboldict[sym]][int(num) - 1] = 1
cnt = 0;
numdict = {num:sym for sym,num in symboldict.items()}
for j in range(len(cardlist)):
    for i in range(len(cardlist[j])):
        if cardlist[j][i] == 0:
            print('{0} {1:2d}'.format(numdict[j], i + 1))
print()