cards = [
    "{0} {1}".format(s,r)
    for s in ("S","H","C","D")
    for r in range(1,13+1)]
    
n = int(input())

for i in range(n):
    card = input()
    cards.remove(card)

for i in cards:
    print(i)
