n = int(input())
l = []
for i in range(n):
    a,b =input().split()
    b = int(b)
    l.append([a,b])
for y in ["S","H","C","D"]:
    for x in range(1, 14):
        if [y,x] not in l:
            print(y,x)
