line = int(eval(input()))



s_set = [x for x in range(1, 14)]

h_set = s_set[:]

c_set = s_set[:]

d_set = s_set[:]



taro_list = []

for i in range(line):

    taro_list.append(eval(input()))



for card in taro_list:

    suite = card.split(" ")[0]

    num = int(card.split(" ")[1])

    if suite == "S": s_set.remove(num)

    if suite == "H": h_set.remove(num)

    if suite == "C": c_set.remove(num)

    if suite == "D": d_set.remove(num)



for e in s_set:

    print(("S " + str(e)))



for e in h_set:

    print(("H " + str(e)))





for e in c_set:

    print(("C " + str(e)))



for e in d_set:

    print(("D " + str(e)))
s, h, c, d = [],[],[],[]



n = int(eval(input()))



#add cards

for _ in range(n):

    suit, rank = input().split()

    rank = int(rank)

    if suit == "S":

        s.append(rank)

    elif suit == "H":

        h.append(rank)

    elif suit == "C":

        c.append(rank)

    elif suit == "D":

        d.append(rank)



#check cards

s_missing, h_missing, c_missing, d_missing = [],[],[],[]

for i in range(1, 14):

    if i not in s:

        s_missing.append(i) 

    if i not in h:

        h_missing.append(i) 

    if i not in c:

        c_missing.append(i) 

    if i not in d:

        d_missing.append(i) 



#print missing cards

for card in s_missing:

    print(("S", card))

for card in h_missing:

    print(("H", card))

for card in c_missing:

    print(("C", card))

for card in d_missing:

    print(("D", card))





line = int(eval(input()))
s_set = [x for x in range(1, 14)]
h_set = s_set[:]
c_set = s_set[:]
d_set = s_set[:]
taro_list = []
for i in range(line):
    taro_list.append(eval(input()))
for card in taro_list:
    suite = card.split(" ")[0]
    num = int(card.split(" ")[1])
    if suite == "S":
        s_set.remove(num)
    if suite == "H":
        h_set.remove(num)
    if suite == "C":
        c_set.remove(num)
    if suite == "D":
        d_set.remove(num)
for e in s_set:
    print(("S " + str(e)))
for e in h_set:
    print(("H " + str(e)))
for e in c_set:
    print(("C " + str(e)))
for e in d_set:
    print(("D " + str(e)))

s, h, c, d = [], [], [], []
n = int(eval(input()))
# add cards
for _ in range(n):
    suit, rank = input().split()
    rank = int(rank)
    if suit == "S":
        s.append(rank)
    elif suit == "H":
        h.append(rank)
    elif suit == "C":
        c.append(rank)
    elif suit == "D":
        d.append(rank)
# check cards
s_missing, h_missing, c_missing, d_missing = [], [], [], []
for i in range(1, 14):
    if i not in s:
        s_missing.append(i)
    if i not in h:
        h_missing.append(i)
    if i not in c:
        c_missing.append(i)
    if i not in d:
        d_missing.append(i)
# print missing cards
for card in s_missing:
    print(("S", card))
for card in h_missing:
    print(("H", card))
for card in c_missing:
    print(("C", card))
for card in d_missing:
    print(("D", card))

-line = int(eval(input())) -s_set = [x for x in range(1, 14)] -h_set = s_set[:] -c_set = s_set[:] -d_set = s_set[:] -taro_list = [] -for i in range(line): -    taro_list.append(eval(input())) -for card in taro_list: -    suite = card.split(" ")[0] -    num = int(card.split(" ")[1]) -    if suite == "S": -        s_set.remove(num) -    if suite == "H": -        h_set.remove(num) -    if suite == "C": -        c_set.remove(num) -    if suite == "D": -        d_set.remove(num) -for e in s_set: -    print(("S " + str(e))) -for e in h_set: -    print(("H " + str(e))) -for e in c_set: -    print(("C " + str(e))) -for e in d_set: -    print(("D " + str(e))) +s, h, c, d = [], [], [], [] +n = int(eval(input())) +# add cards +for _ in range(n): +    suit, rank = input().split() +    rank = int(rank) +    if suit == "S": +        s.append(rank) +    elif suit == "H": +        h.append(rank) +    elif suit == "C": +        c.append(rank) +    elif suit == "D": +        d.append(rank) +# check cards +s_missing, h_missing, c_missing, d_missing = [], [], [], [] +for i in range(1, 14): +    if i not in s: +        s_missing.append(i) +    if i not in h: +        h_missing.append(i) +    if i not in c: +        c_missing.append(i) +    if i not in d: +        d_missing.append(i) +# print missing cards +for card in s_missing: +    print(("S", card)) +for card in h_missing: +    print(("H", card)) +for card in c_missing: +    print(("C", card)) +for card in d_missing: +    print(("D", card))