n = int(eval(input()))

s = [0 for s in range(13)]

h = [0 for s in range(13)]

c = [0 for s in range(13)]

d = [0 for s in range(13)]

for i in range(n):

    design, N = input().split()

    N = int(N)

    if design == "S":

        s[N-1] = 1

    elif design == "H":

        h[N-1] = 1

    elif design == "C":

        c[N-1] = 1

    else:

        d[N-1] = 1



for i in range(13):

    if s[i] == 0:

        print(("S {0}".format(i + 1)))



for i in range(13):

    if h[i] == 0:

        print(("H {0}".format(i + 1)))



for i in range(13):

    if c[i] == 0:

        print(("C {0}".format(i + 1)))



for i in range(13):

    if d[i] == 0:

        print(("D {0}".format(i + 1)))

        
n = int(eval(input()))

card = set()

for i in range(n):

    card_type, card_num = input().split()

    card.add(card_type + card_num)

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

    for card_num in range(1, 14):

        if card_type + str(card_num) not in card:

            print((card_type + " " + str(card_num)))
n = int(eval(input()))
s = [0 for s in range(13)]
h = [0 for s in range(13)]
c = [0 for s in range(13)]
d = [0 for s in range(13)]
for i in range(n):
    design, N = input().split()
    N = int(N)
    if design == "S":
        s[N - 1] = 1
    elif design == "H":
        h[N - 1] = 1
    elif design == "C":
        c[N - 1] = 1
    else:
        d[N - 1] = 1
for i in range(13):
    if s[i] == 0:
        print(("S {0}".format(i + 1)))
for i in range(13):
    if h[i] == 0:
        print(("H {0}".format(i + 1)))
for i in range(13):
    if c[i] == 0:
        print(("C {0}".format(i + 1)))
for i in range(13):
    if d[i] == 0:
        print(("D {0}".format(i + 1)))

n = int(eval(input()))
card = set()
for i in range(n):
    card_type, card_num = input().split()
    card.add(card_type + card_num)
for card_type in ["S", "H", "C", "D"]:
    for card_num in range(1, 14):
        if card_type + str(card_num) not in card:
            print((card_type + " " + str(card_num)))

-s = [0 for s in range(13)] -h = [0 for s in range(13)] -c = [0 for s in range(13)] -d = [0 for s in range(13)] +card = set() -    design, N = input().split() -    N = int(N) -    if design == "S": -        s[N - 1] = 1 -    elif design == "H": -        h[N - 1] = 1 -    elif design == "C": -        c[N - 1] = 1 -    else: -        d[N - 1] = 1 -for i in range(13): -    if s[i] == 0: -        print(("S {0}".format(i + 1))) -for i in range(13): -    if h[i] == 0: -        print(("H {0}".format(i + 1))) -for i in range(13): -    if c[i] == 0: -        print(("C {0}".format(i + 1))) -for i in range(13): -    if d[i] == 0: -        print(("D {0}".format(i + 1))) +    card_type, card_num = input().split() +    card.add(card_type + card_num) +for card_type in ["S", "H", "C", "D"]: +    for card_num in range(1, 14): +        if card_type + str(card_num) not in card: +            print((card_type + " " + str(card_num)))