num = int(input())
a = "SHCD"
table = [[i,m] for i in a for m in range(1,14)]

for i in range(num):
    card = input().split()
    card[1] = int(card[1])
    table.remove(card)

for m in table:
    print("{0} {1}".format(m[0],m[1]))