'use strict';
(function(stdin) {
  var suits = {
    'S': 0, 'H': 1, 'C': 2,'D': 3
  };
  var lines  = stdin.toString().split('\n');
  var result = (function(data) {
    return new Range(52)
      .filter(function(v){
        return this.indexOf(v) === -1;
      },data.map(function(v) {
        var cols = v.split(' ');
        return (suits[cols[0]] * 13) + (parseInt(cols[1],10) - 1);
      }))
      .map(function(v){
        return cards(v);
      }).join('\n');

    function cards(number) {
      var suits = ['S','H','C','D'];
      return [
        suits[~~(number / 13)]
        ,(number % 13) + 1
      ].join(' ');
    }

    function Range(num) {
      var result =[];
      for (var i = 0; i < num; i++) {
        result.push(i)
      }
      return result;
    }
  }(lines.slice(0,lines.shift())
  ));
  console.log(result);
}(require('fs').readFileSync('/dev/stdin', 'utf8')));