r=range

v=input

l=[i+" "+str(j)for i in["S","H","C","D"]for j in r(1,14)]

for i in r(int(v())):l.remove(v())

for i in l:print(i)
r=range

v=input

l=[i+" "+str(j)for i in"SHCD" for j in r(1,14)]

for i in r(int(v())):l.remove(v())

for i in l:print(i)
r = range
v = input
l = [i + " " + str(j) for i in ["S", "H", "C", "D"] for j in r(1, 14)]
for i in r(int(v())):
    l.remove(v())
for i in l:
    print(i)

r = range
v = input
l = [i + " " + str(j) for i in "SHCD" for j in r(1, 14)]
for i in r(int(v())):
    l.remove(v())
for i in l:
    print(i)

-l = [i + " " + str(j) for i in ["S", "H", "C", "D"] for j in r(1, 14)] +l = [i + " " + str(j) for i in "SHCD" for j in r(1, 14)]