n = int(input())

cards, suits = [], ["S", "H", "C", "D"]

for suit in suits:

    for x in range(1, 14):

        cards.append('{} {}'.format(suit, x))



for _ in range(n):

    target = ' '.join(input().split())

    if target in cards:

        cards.remove(target)



[print(c) for c in cards]

# ２次元配列バージョン

# かつ、内包表記バージョン

n = int(input())

suits = ["S", "H", "C", "D"]

cards = [[s, n] for s in suits for n in range(1, 14)]

for i in range(n):

    target = list(map(

        lambda a: int(a) if a.isnumeric() else a, input().split()

    ))

    if target in cards:

        cards.remove(target)

[print("{} {}".format(c[0], c[1])) for c in cards]



n = int(input())
cards, suits = [], ["S", "H", "C", "D"]
for suit in suits:
    for x in range(1, 14):
        cards.append("{} {}".format(suit, x))
for _ in range(n):
    target = " ".join(input().split())
    if target in cards:
        cards.remove(target)
[print(c) for c in cards]

# ２次元配列バージョン
# かつ、内包表記バージョン
n = int(input())
suits = ["S", "H", "C", "D"]
cards = [[s, n] for s in suits for n in range(1, 14)]
for i in range(n):
    target = list(map(lambda a: int(a) if a.isnumeric() else a, input().split()))
    if target in cards:
        cards.remove(target)
[print("{} {}".format(c[0], c[1])) for c in cards]

+# ２次元配列バージョン +# かつ、内包表記バージョン -cards, suits = [], ["S", "H", "C", "D"] -for suit in suits: -    for x in range(1, 14): -        cards.append("{} {}".format(suit, x)) -for _ in range(n): -    target = " ".join(input().split()) +suits = ["S", "H", "C", "D"] +cards = [[s, n] for s in suits for n in range(1, 14)] +for i in range(n): +    target = list(map(lambda a: int(a) if a.isnumeric() else a, input().split())) -[print(c) for c in cards] +[print("{} {}".format(c[0], c[1])) for c in cards]