S_cards=[]

H_cards=[]

C_cards=[]

D_cards=[]



for i in range(1,14):

    S_cards.append(i)

    H_cards.append(i)

    C_cards.append(i)

    D_cards.append(i)



now_cards=int(eval(input()))

for i in range(0,now_cards):

    kind_num=[]

    kind_num=input().split()

    if kind_num[0]=='S':

        S_cards.remove(int(kind_num[1]))

    elif kind_num[0]=='H':

        H_cards.remove(int(kind_num[1]))

    elif kind_num[0]=='C':

        C_cards.remove(int(kind_num[1]))

    elif kind_num[0]=='D':

        D_cards.remove(int(kind_num[1]))

for i in range(0,len(S_cards)):

    print(('S',S_cards[i]))

for i in range(0,len(H_cards)):

    print(('H',H_cards[i]))

for i in range(0,len(C_cards)):

    print(('C',C_cards[i]))

for i in range(0,len(D_cards)):

    print(('D',D_cards[i]))
S=[i for i in range(1,14)]

H=[i for i in range(1,14)]

C=[i for i in range(1,14)]

D=[i for i in range(1,14)]

cards=int(eval(input()))

for i in range(0,cards):

    mark,rank=input().split()

    rank=int(rank)

    if mark=="S":

        S.remove(rank)

    elif mark=="H":

        H.remove(rank)

    elif mark=="C":

        C.remove(rank)

    elif mark=="D":

        D.remove(rank)

for i in S:

    print(("S",i))

for i in H:

    print(("H",i))

for i in C:

    print(("C",i))

for i in D:

    print(("D",i))
S_cards = []
H_cards = []
C_cards = []
D_cards = []
for i in range(1, 14):
    S_cards.append(i)
    H_cards.append(i)
    C_cards.append(i)
    D_cards.append(i)
now_cards = int(eval(input()))
for i in range(0, now_cards):
    kind_num = []
    kind_num = input().split()
    if kind_num[0] == "S":
        S_cards.remove(int(kind_num[1]))
    elif kind_num[0] == "H":
        H_cards.remove(int(kind_num[1]))
    elif kind_num[0] == "C":
        C_cards.remove(int(kind_num[1]))
    elif kind_num[0] == "D":
        D_cards.remove(int(kind_num[1]))
for i in range(0, len(S_cards)):
    print(("S", S_cards[i]))
for i in range(0, len(H_cards)):
    print(("H", H_cards[i]))
for i in range(0, len(C_cards)):
    print(("C", C_cards[i]))
for i in range(0, len(D_cards)):
    print(("D", D_cards[i]))

S = [i for i in range(1, 14)]
H = [i for i in range(1, 14)]
C = [i for i in range(1, 14)]
D = [i for i in range(1, 14)]
cards = int(eval(input()))
for i in range(0, cards):
    mark, rank = input().split()
    rank = int(rank)
    if mark == "S":
        S.remove(rank)
    elif mark == "H":
        H.remove(rank)
    elif mark == "C":
        C.remove(rank)
    elif mark == "D":
        D.remove(rank)
for i in S:
    print(("S", i))
for i in H:
    print(("H", i))
for i in C:
    print(("C", i))
for i in D:
    print(("D", i))

-S_cards = [] -H_cards = [] -C_cards = [] -D_cards = [] -for i in range(1, 14): -    S_cards.append(i) -    H_cards.append(i) -    C_cards.append(i) -    D_cards.append(i) -now_cards = int(eval(input())) -for i in range(0, now_cards): -    kind_num = [] -    kind_num = input().split() -    if kind_num[0] == "S": -        S_cards.remove(int(kind_num[1])) -    elif kind_num[0] == "H": -        H_cards.remove(int(kind_num[1])) -    elif kind_num[0] == "C": -        C_cards.remove(int(kind_num[1])) -    elif kind_num[0] == "D": -        D_cards.remove(int(kind_num[1])) -for i in range(0, len(S_cards)): -    print(("S", S_cards[i])) -for i in range(0, len(H_cards)): -    print(("H", H_cards[i])) -for i in range(0, len(C_cards)): -    print(("C", C_cards[i])) -for i in range(0, len(D_cards)): -    print(("D", D_cards[i])) +S = [i for i in range(1, 14)] +H = [i for i in range(1, 14)] +C = [i for i in range(1, 14)] +D = [i for i in range(1, 14)] +cards = int(eval(input())) +for i in range(0, cards): +    mark, rank = input().split() +    rank = int(rank) +    if mark == "S": +        S.remove(rank) +    elif mark == "H": +        H.remove(rank) +    elif mark == "C": +        C.remove(rank) +    elif mark == "D": +        D.remove(rank) +for i in S: +    print(("S", i)) +for i in H: +    print(("H", i)) +for i in C: +    print(("C", i)) +for i in D: +    print(("D", i))