const reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout
});
const helix = {"A": "T", "C":"G", "G": "C", "T": "A"}
reader.on("line", function (line) {
  console.log(helix[line]);
});
