<?php
	fscanf( STDIN, "%d", $n );
	$shcd = array( 'S', 'H', 'C', 'D' );
	$cardSet = array();
	for( $i=0; $i<4; $i++ ) {
		for( $j=1; $j<=13; $j++ ) {
			array_push( $cardSet, $shcd[$i].' '.$j );
		}
	}
	$taroCards = array();
	for( $i=0; $i<$n; $i++ ) {
		$c = trim( fgets( STDIN ) );
		array_push( $taroCards, $c );
	}
	print implode( PHP_EOL, array_diff( $cardSet, $taroCards  ) );
?>