function Main(input){
    r=[["A","T"],["C","G"]];
    for(i=0;i<2;i++){
        if(input==r[i][0])console.log(r[i][1]);
        if(input==r[i][1])console.log(r[i][0]);
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
