n=int(input())
card={"S":[0]*13,"H":[0]*13,"C":[0]*13,"D":[0]*13}

for i in range(n):
    mark, number = input().split()
    card[mark][int(number)-1] = 1


for a in ("S","H","C","D"):
    for b in range(13):
        if cards[a][b] == 0:
            print(a,b+1)