let content = '';
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', buf => {
  content += buf;
});
process.stdin.on('end', () => {
  const cards = {
    S: new Set(),
    H: new Set(),
    C: new Set(),
    D: new Set(),
  };

  const [, ...lines] = content.trim().split('\n');
  for (let line of lines) {
    const [kind, num] = line.split(' ');
    cards[kind].add(parseInt(num, 10));
  }

  for (let kind of ['S', 'H', 'C', 'D']) {
    const nums = getMissingNums(cards[kind]).sort((a, b) => a - b);
    if (nums.length > 0) {
      console.log(nums.map(n => `${kind} ${n}`).join('\n'));
    }
  }
});

const getMissingNums = map => {
  const missingNums = [];
  for (let i = 1; i <= 13; i++) {
    if (!map.has(i)) {
      missingNums.push(i);
    }
  }

  return missingNums;
};
