list = []
for x in ["S", "H", "C", "D"]:
    for y in [str(i) for i in range(1, 14)]:
        list.append(x+" "+y)
n = int(input())
while n > 0:
    list.remove(input())
    n -= 1
for i in list:
    print(i)
