num = int(eval(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))

    
list = []

for x in ["S", "H", "C", "D"]:

    for y in [str(i) for i in range(1, 14)]:

        list.append(x+" "+y)

n = int(eval(input()))

while n > 0:

    list.remove(eval(input()))

    n -= 1

for i in list:

    print(i)

num = int(eval(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))

list = []
for x in ["S", "H", "C", "D"]:
    for y in [str(i) for i in range(1, 14)]:
        list.append(x + " " + y)
n = int(eval(input()))
while n > 0:
    list.remove(eval(input()))
    n -= 1
for i in list:
    print(i)

-num = int(eval(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)) +list = [] +for x in ["S", "H", "C", "D"]: +    for y in [str(i) for i in range(1, 14)]: +        list.append(x + " " + y) +n = int(eval(input())) +while n > 0: +    list.remove(eval(input())) +    n -= 1 +for i in list: +    print(i)