card ={'S': [0]*13,
       'H': [0]*13,
       'C': [0]*13,
       'D': [0]*13
}

n = int(input())

for i in range(1,n+1):
    m,num = input().split()
    num = int(num)
    card[m][num-1] =1

for c in ["S","H","C","D"]:
    for j in range(1,14):
        if (card[c][i]==0):
            print(m,str(j))
