d = dict()
for i in "HSDC":
    d[i] = set()
for _ in range(int(input())):
    mark,num = input().split()
    d[mark].add(int(num))
for i in "SHCD":
    for j in range(1,14):
        if j not in d[i]:
            print(i,j)
