number = int(input())
dict = {}
for x in ["S","H","C","D"]:
        dict[x] = [i for i in range(1,14)]
for i in range(number):
    x,y = map(str,input().split())
    dict[x].remove(int(y))
print(dict)