'use strict'

function Main(input){
	const b = input.trim();

	const answer = new Array(b.length);
	for(let i=0,l=b.length;i<l;i++){
		switch(b[i]){
			case 'A': answer[i] = 'T'; break;
			case 'T': answer[i] = 'A'; break;
			case 'C': answer[i] = 'G'; break;
			case 'G': answer[i] = 'C'; break;
		}
	}
	console.log(answer.join(''));
}

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