'use strict';
(function(stdin) {
  //declare function
  function indexCards(array) {
    var a = array[0];
    var num = Number(array[1]);
    allCards[a].some(function(v, i) {
      if (v === num) {
        return allCards[a].splice(i, 1);
      }
    });
  }

  //declare variable
  var inputs = stdin.toString().trim().split('\n');
  var thereCards = inputs.map(function(v) {
    return v.split(' ');
  }).slice(1);
  var mark = ['S', 'H', 'C', 'D'];
  var allCards = {
    'S': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
    'H': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
    'C': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
    'D': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
  };
  var output = [];

  //main
  thereCards.map(indexCards);
  for (mark in allCards) {
    allCards[mark].map(function(v) {
      output.push(mark + ' ' + v);
    });
  }
  // console.log(allCards);
  if (output.length > 0) {
    console.log(output.join('\n'));
  }
})(require('fs').readFileSync('/dev/stdin', 'utf8'));