var input = require('fs').readFileSync('/dev/stdin', 'utf8');
let lines = input.split("\n");
if (Number(lines[0]) === 52) {
  return false;
}

let myCards = {
  'S':[],
  'H':[],
  'C':[],
  'D':[]
};
let result = '';

for (var i = 1; i < lines.length; i++) {
  let mark = lines[i].substr(0,1);
    let target;
    //myCards[mark].push は run でエラー
    switch (mark) {
    case 'S':
      myCards.S.push(Number(lines[i].substr(1)));
      break;
    case 'H':
      myCards.H.push(Number(lines[i].substr(1)));
      break;
    case 'C':
      myCards.C.push(Number(lines[i].substr(1)));
      break;
    case 'D':
      myCards.D.push(Number(lines[i].substr(1)));
      break;
    default:
    break;
  }
}

for (var mark in myCards) {
 for (var count = 1; count <= 13; count++) {
   if (myCards[mark].indexOf(count) == -1){
  // 存在しない
  result += mark + ' ' + count + '\n';
  }
 }
}

console.log(result.slice( 0, -1));
