# -*- coding: utf-8 -*-

def main():

	suits = ('S','H','C','D')
	cards = [[0 for i in xrange(13)] for i in xrange(4)]
	n = input()
	for i in xrange(n):
		suit,rank = raw_input().split()
		suit = suits.index(suit)
		rank = int(rank)
		cards[suit][rank-1] = 1

	for suit,ranks in enumerate(cards):
		for rank,flag in enumerate(ranks):
			if flag == 0:
				print(suits[suit]),
				print(rank+1)

if __name__ == "__main__":

	main()
