all=set()
for i in ['S','H','C','D']:
    for j in range(1,14):
        all=all.add('{0} {1}'.format(str(i), str(j)))
n=input() .split()
while True:
    a=input().split()
    t += str(a[0])
    r =+ int(a[1])
all2=set()
for y in t:
    for u in r:
        all2 = all2.add('{0} {1}'.format(str(y),str(u))
print(all-all2)