from collections import OrderedDict
def solve():
    n = int(input())
    if n >= 52:
        print("")
        return
    m = OrderedDict()
    for c in "SHCD":
        for i in range(1, 14):
            m[c + " " + str(i)] = 0
    for _ in range(n):
        del m[input()]
    print(*m.keys(), sep="\n")
solve()

