n = int(input())
cards = []
for i in range(n):
    a,b = input().split()
    cards.append([a,int(b)])

for c in ['S','H','C','D']:
    for number in range(1,14):
        if not [c,number] in cards:
            print(c+' '+str(number))
