import sys

def main():
    lines = sys.stdin.readlines()

    remaining_cards_num = 0
    S = [] # Spade
    H = [] # Heart
    C = [] # Club
    D = [] # Diamond
    for index, line in enumerate(lines):
        line = line.strip('\n')
        elems = line.split(" ")
        #print elems
        if index == 0:
            remaining_cards_num = int(elems[0])
        elif index <= remaining_cards_num:
            if elems[0] == "S":
                S.append(int(elems[1]))
            elif elems[0] == "H":
                H.append(int(elems[1]))
            elif elems[0] == "C":
                C.append(int(elems[1]))
            elif elems[0] == "D":
                D.append(int(elems[1]))
        else:
            break

    for i in range(1, 13+1):
        if i not in S:
            print("S %d" % (i))
    for i in range(1, 13+1):
        if i not in H:
            print("H %d" % (i))
    for i in range(1, 13+1):
        if i not in C:
            print("C %d" % (i))
    for i in range(1, 13+1):
        if i not in D:
            print("D %d" % (i))

if __name__ == "__main__":
    main()