mark = ('S', 'H', 'C', 'D')
tr = {m:{i for i in range(1, 14)} for m in mark}
n = int(input())
for i in range(n):
    m, p = input().split()
    tr[m].remove(int(p))
for j in mark:
    for q in sorted(tr[j]):
        print(j, q)
