L = []
for m in ["S", "H", "C", "D"]:
    for i in range(1, 14):
        L.append((m, i))
n = int(input())
for i in range(n):
    mark, rank = input().split()
    rank = int(rank)
    L.remove((mark, rank))
for rest in L:
    print(rest[0], rest[1])
