def main():



    numlist = set()

    x = int(eval(input()))



    for _ in range(x):

        numlist.add(tuple(input().split()))

    

    cards = set()

    for mark in ('S', 'H', 'C', 'D'):

        for i in range(1,14):

            cards.add((mark, str(i)))



    for item in numlist:

        cards.remove(item)



    for mark in ('S', 'H', 'C', 'D'):

        for i in range(1, 14):

            if (mark, str(i)) in cards:

                print((mark, i))



if __name__ == '__main__':

    main()

cards = []

n = int(eval(input()))

for _ in range(n):

    cards.append(eval(input()))



# カードを全部用意する

suits = ('S', 'H', 'C', 'D')

res_cards = []

for suit in suits:

    for i in range(1, 14):

        res_cards.append(suit+' '+str(i))



for card in cards:

    res_cards.remove(card)



for card in res_cards:

    print(card)

def main():
    numlist = set()
    x = int(eval(input()))
    for _ in range(x):
        numlist.add(tuple(input().split()))
    cards = set()
    for mark in ("S", "H", "C", "D"):
        for i in range(1, 14):
            cards.add((mark, str(i)))
    for item in numlist:
        cards.remove(item)
    for mark in ("S", "H", "C", "D"):
        for i in range(1, 14):
            if (mark, str(i)) in cards:
                print((mark, i))


if __name__ == "__main__":
    main()

cards = []
n = int(eval(input()))
for _ in range(n):
    cards.append(eval(input()))
# カードを全部用意する
suits = ("S", "H", "C", "D")
res_cards = []
for suit in suits:
    for i in range(1, 14):
        res_cards.append(suit + " " + str(i))
for card in cards:
    res_cards.remove(card)
for card in res_cards:
    print(card)

-def main(): -    numlist = set() -    x = int(eval(input())) -    for _ in range(x): -        numlist.add(tuple(input().split())) -    cards = set() -    for mark in ("S", "H", "C", "D"): -        for i in range(1, 14): -            cards.add((mark, str(i))) -    for item in numlist: -        cards.remove(item) -    for mark in ("S", "H", "C", "D"): -        for i in range(1, 14): -            if (mark, str(i)) in cards: -                print((mark, i)) - - -if __name__ == "__main__": -    main() +cards = [] +n = int(eval(input())) +for _ in range(n): +    cards.append(eval(input())) +# カードを全部用意する +suits = ("S", "H", "C", "D") +res_cards = [] +for suit in suits: +    for i in range(1, 14): +        res_cards.append(suit + " " + str(i)) +for card in cards: +    res_cards.remove(card) +for card in res_cards: +    print(card)