function Main(input) {
  let args = input.trim().split("\n");
  let n = parseInt(args[0], 10);

  let table = Array.from(new Array(4), () => new Array(13).fill(false));
  for (let i = 0; i < n; i++) {
    let mark = args[i + 1].split(" ")[0];
    let value = parseInt(args[i + 1].split(" ")[1], 10);
    if (mark === "S") {
      table[0][value - 1] = true;
    }
    if (mark === "H") {
      table[1][value - 1] = true;
    }
    if (mark === "C") {
      table[2][value - 1] = true;
    }
    if (mark === "D") {
      table[3][value - 1] = true;
    }
  }

  const m = ["S", "H", "C", "D"];
  for (let mark = 0; mark < 4; mark++) {
    for (let v = 0; v < 13; v++) {
      if (table[mark][v] === false) {
        console.log(m[mark] + " " + String(v + 1));
      }
    }
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
