var input_str = require('fs').readFileSync('/dev/stdin', 'UTF-8');
// console.log(input_str);
var ary = input_str.split('\n')
ary = ary.filter((item, i) => {
  return i !== 0
});
ary.pop()
// console.log(ary);
var t = {
  "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]
}
// for (var i = 0; i < 13; i++){
//   console.log(t);
// }
// for (var j = 0; j < 4; j++){
//   console.log(t);
// }

for(var i=0;i<ary.length;i++){
  var line = ary[i];

  var values = line.split(" ")

  // console.log(values[0])
  // console.log(t[values[0]]);
  t[values[0]] = t[values[0]].filter((item) => {
    // console.log(values[1])
    return item !== Number.parseInt(values[1]);
  })
  // console.log(result)
}
// var value = ary;
// console.log(t);


for(var key in t){
  for(var c=0;c<t[key].length;c++){
  console.log(key + " " + t[key][c]);
}
}

