n=int(input())
S=[int(0) for i in range(1,14)]
H=[int(0) for i in range(1,14)]
D=[int(0) for i in range(1,14)]
C=[int(0) for i in range(1,14)]
for i in range(n):
    K,y=[(i) for i in input().split()]
    if K=='S':
        S[int(y)-1]=1
    elif K=='H':
        H[int(y)-1]=1
    elif K=='D':
        D[int(y)-1]=1
    else:
        C[int(y)-1]=1
for i in range(1,14):
    if S[int(i)-1]==0:
        print('S',"{0}".format(i))
for i in range(1,14):
    if H[int(i)-1]==0:
        print('H',"{0}".format(i))
for i in range(1,14):
    if D[int(i)-1]==0:
        print('D',"{0}".format(i))
for i in range(1,14):
    if C[int(i)-1]==0:
        print('C',"{0}".format(i))