from sys import stdin



cards = {}



n = int(eval(input()))

for line in stdin:

    m, num = line.rstrip().split(' ')

    cards[(m, int(num))] = True



for s in ['S','H','C','D']:

    for i in range(1, 14):

        if not (s, i) in cards:

            print(("{} {}".format(s, i)))
marks = ["S", "H", "C", "D"]

cards = {}



n = int(eval(input()))



for _ in range(0, n):

    mark, num = input().split()



    if mark not in cards:

        cards[mark] = []



    cards[mark].append(int(num))



for mark in marks:

    for n in range(1, 14):

        if n in cards[mark]:

            continue



        print(("{} {}".format(mark, n)))



from sys import stdin

cards = {}
n = int(eval(input()))
for line in stdin:
    m, num = line.rstrip().split(" ")
    cards[(m, int(num))] = True
for s in ["S", "H", "C", "D"]:
    for i in range(1, 14):
        if not (s, i) in cards:
            print(("{} {}".format(s, i)))

marks = ["S", "H", "C", "D"]
cards = {}
n = int(eval(input()))
for _ in range(0, n):
    mark, num = input().split()
    if mark not in cards:
        cards[mark] = []
    cards[mark].append(int(num))
for mark in marks:
    for n in range(1, 14):
        if n in cards[mark]:
            continue
        print(("{} {}".format(mark, n)))

-from sys import stdin - +marks = ["S", "H", "C", "D"] -for line in stdin: -    m, num = line.rstrip().split(" ") -    cards[(m, int(num))] = True -for s in ["S", "H", "C", "D"]: -    for i in range(1, 14): -        if not (s, i) in cards: -            print(("{} {}".format(s, i))) +for _ in range(0, n): +    mark, num = input().split() +    if mark not in cards: +        cards[mark] = [] +    cards[mark].append(int(num)) +for mark in marks: +    for n in range(1, 14): +        if n in cards[mark]: +            continue +        print(("{} {}".format(mark, n)))