a=[];b="SHCD"

for i in range(4*13):a.append(b[i/13]+" "+str(i%13+1))

for i in range(eval(input())):a.remove(input())

for i in a:print(i)
a=[]

for i in range(4*13):a.append("SHCD"[i/13]+" "+str(i%13+1))

for i in range(eval(input())):a.remove(input())

for i in a:print(i)
a = []
b = "SHCD"
for i in range(4 * 13):
    a.append(b[i / 13] + " " + str(i % 13 + 1))
for i in range(eval(input())):
    a.remove(input())
for i in a:
    print(i)

a = []
for i in range(4 * 13):
    a.append("SHCD"[i / 13] + " " + str(i % 13 + 1))
for i in range(eval(input())):
    a.remove(input())
for i in a:
    print(i)

-b = "SHCD" -    a.append(b[i / 13] + " " + str(i % 13 + 1)) +    a.append("SHCD"[i / 13] + " " + str(i % 13 + 1))