from collections import OrderedDict

d = OrderedDict(("{} {}".format(c, n), 0) for c in "SHCD" for n in range(1, 14))

n = int(input())

if n != 52:
    for _ in range(n):
        d.pop(input())

    for k in d:
        print(k)