N = int(input())
n = [input().split() for _ in range(N)]

all_card = {"S": [], "H": [], "C": [], "D": []}
number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]

for k in n:
    all_card[k[0]].append(int(k[1]))

for c in ["S", "H", "C", "D"]:
    res = set(number) - set(all_card[c])
    for n in list(res):
        print("{} {}".format(c, n))
