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