n = int(input())
i = 0
se = set()
while i < n:
    se.add(input())
    i += 1

for suit in ['S','H','C','D']:
    for rank in range(1,14):
        if suit + ' ' + str(rank) not in se:
            print(suit,rank)

