s = {suits: list(range(1, 14)) for suits in ["S", "H", "C", "D"]}

n = int(input())
for i in range(n):
    pict, num = tuple(input().split())
    s[pict].remove(int(num))

for i in s:
    for j in s[i]:
        print(i + " " + str(j))
