from collections import OrderedDict



cards = OrderedDict()

cards['S'] = set()

cards['H'] = set()

cards['C'] = set()

cards['D'] = set()



n = int(eval(input()))

for _ in range(n):

    suit, num = input().split()

    num = int(num)

    cards[suit].add(num)



for suit, nums in list(cards.items()):

    for num in range(1,14):

        if num not in nums:

            print((suit, num))
n = int(eval(input()))

deck = []

for i in range(n):

    deck.append(eval(input()))



for suit in 'SHCD':

    for i in range(1, 14):

        card = f'{suit} {i}'

        if card not in deck:

            print(card)



from collections import OrderedDict

cards = OrderedDict()
cards["S"] = set()
cards["H"] = set()
cards["C"] = set()
cards["D"] = set()
n = int(eval(input()))
for _ in range(n):
    suit, num = input().split()
    num = int(num)
    cards[suit].add(num)
for suit, nums in list(cards.items()):
    for num in range(1, 14):
        if num not in nums:
            print((suit, num))

n = int(eval(input()))
deck = []
for i in range(n):
    deck.append(eval(input()))
for suit in "SHCD":
    for i in range(1, 14):
        card = f"{suit} {i}"
        if card not in deck:
            print(card)

-from collections import OrderedDict - -cards = OrderedDict() -cards["S"] = set() -cards["H"] = set() -cards["C"] = set() -cards["D"] = set() -for _ in range(n): -    suit, num = input().split() -    num = int(num) -    cards[suit].add(num) -for suit, nums in list(cards.items()): -    for num in range(1, 14): -        if num not in nums: -            print((suit, num)) +deck = [] +for i in range(n): +    deck.append(eval(input())) +for suit in "SHCD": +    for i in range(1, 14): +        card = f"{suit} {i}" +        if card not in deck: +            print(card)