n = int(input())
suits = ["S", "H", "C", "D"]
cards = []
for i in suits:
    for j in range(1, 14):
        cards.append([i, str(j)])
for i in range(n):
    s, r = input().split()
    cards.remove([s, r])
for i in cards:
    print(i[0] + " " + i[1])
