n=int(input())
card_have=[input().split() for i in range(n)]

nums={1,2,3,4,5,6,7,8,9,10,11,12,13}

s_have={int(s[1]) for s in card_have if s[0]=="S"}
h_have={int(h[1]) for h in card_have if h[0]=="H"}
c_have={int(c[1]) for c in card_have if c[0]=="C"}
d_have={int(d[1]) for d in card_have if d[0]=="S"}

s_lost=list(nums^s_have)
h_lost=list(nums^h_have)
c_lost=list(nums^c_have)
d_lost=list(nums^d_have)

s_lost.sort()
h_lost.sort()
c_lost.sort()
d_lost.sort()

for s in s_lost:
    print("S",s)
for h in h_lost:
    print("H",h)
for c in c_lost:
    print("C",c)
for d in d_lost:
    print("D",d)