var input = '';
var readable = process.stdin;
readable.resume();
readable.setEncoding( 'utf-8' );
readable.on( 'data', function( chunk ) {
  input += chunk;
});

readable.on( 'end', function() {
  var cards = { "S":[] , "H":[], "C":[], "D":[] };
  var shcd = [ 'S', 'H', 'C', 'D' ];
  for( var key in cards ) {
    for( var i=1; i<=13; i++ ) {
      cards[key].push( i );
    }
  }
  var data = input.split( '\n' );
  
  for( var i=1; i<data.length; i++ ) {
    var x = data[i].split( ' ' );

    var k = "S";
    if( 'S' === x[0] ) {
      k = 'S';
    } else if( 'H' === x[0] ) {
      k = 'H';
    } else if( 'C' === x[0] ) {
      k = 'C';
    } else if( 'D' === x[0] ) {
      k = 'D';
    }
    var res = cards[k].indexOf( Number( p[1] ) );
    if( -1 != res ) {
        cards[k].splice( res, 1 );
    }
  }
  for( var i=0; i<4; i++ ) {
    for( var j = 0; j<cards[ shcd[i] ].length; j++ ) {
      console.log( shcd[i]+" "+cards[ shcd[i] ][j] );
    }
  }
});