function Main(input) {
    input = input.split("\n");
    var map = new Map([["A", "T"], ["T", "A"], ["C", "G"], ["G", ["C"]]]);
    var b = input[0];
    console.log(map.get(b));
}

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