n = int(raw_input())

s = set()
h = set()
c = set()
d = set()

def print_card(mark, nums):
    r = set(range(1,14)) - nums
    if not len(r) == 0:
        for i in sorted(r):
            print mark, i
    return 0

for i in range(n):
    mark, num = raw_input().split()
    num = int(num)
    if mark == "S":
        s.add(int(num))
    elif mark == "H":
        h.add(int(num))
    elif mark == "C":
        c.add(int(num))
    elif mark == "D":
        d.add(int(num))

print_card("S",s)
print_card("H",h) 
print_card("C",c)
print_card("D",d)   