N = int(input())
MN = [ (mark,number) for mark in ['S', 'H', 'C', 'D'] for number in range(1,14) ]
for _ in range(N):
    mark,number = input().split()
    MN.remove((mark,int(number)))
for (mark, number) in MN:
    print(mark, number)