num = int(input())
cards = [ (design, rank) for design in ['S','H','C','D'] for rank in range(1,14) ]
for i in range(num):
    design, rank = input().split()
    cards.remove((design, int(rank)))
for (design, rank) in cards:
    print(design, rank)
    