n = int(input())

S = [1]*13
H = [1]*13
C = [1]*13
D = [1]*13

for i in range(n):
    mark, number = map(str, input().split())
    num = int(number)
    if mark == "S":
        S[num-1] = 0
    if mark == "H":
        H[num-1] = 0
    if mark == "C":
        C[num-1] = 0
    if mark == "H":
        H[num-1] = 0

for i in range(13):
    if S[i]:
        print("S " + str(i+1))
for i in range(13):
    if H[i]:
        print("H " + str(i+1))
for i in range(13):
    if C[i]:
        print("C " + str(i+1))
for i in range(13):
    if D[i]:
        print("D " + str(i+1))