Taro is going to play a card game. However, now he has only n cards, even though there should be 52 cards (he has no Jokers).  The 52 cards include 13 ranks of each of the four suits: spade, heart, club and diamond.
data = [
    "{0} {1}".format(s,r)
        for s in ('S','H','C','D')
        for r in range(1, 13+1)
]

count = int(input())
for c in range(count):
    card = input()
    data.remove(card)

    print("\n".join(data))
data = [
    "{0} {1}".format(s,r)
        for s in ('S','H','C','D')
        for r in range(1, 13+1)
]

count = int(input())
for c in range(count):
    card = input()
    data.remove(card)
for c in data:
    print(c)