cards = int(input())
i = 0
cardlist = []
while(i < cards):
    cardlist.append(list(map(str,input().split())))
    i += 1
SP = [0] * 13
HR = [0] * 13
CL = [0] * 13
DY = [0] * 13
    
for i in cardlist:
    num = int(i[1])
    if  (i[0] == S):
        SP[num] = 1
    elif(i[0] == H):
        HR[num] = 1
    elif(i[0] == C):
        CL[num] = 1
    elif(i[0] == D):
        DY[num] = 1

c = 0
for i in SP:
    c += 1
    if i == 1:
        print("S %d" %c)
c = 0
for i in HR:
    c += 1
    if i == 1:
        print("H %d" %c)
c = 0
for i in CL:
    if i == 1:
        print("C %d" %c)
c = 0
for i in DY:
    if i == 1:
        print("D %d" %c)
print()
