fun main (args : Array<String>) {
	val str1 = readLine()
	val str2 : String = str1.toString()
	var result : String = ""
	for (i in str2) {
		if (i.toString() == "A") {
			result += "T"
		} else if (i.toString() == "T") {
			result += "A"
		} else if (i.toString() == "C") {
			result += "G"
		} else if (i.toString() == "G") {
			result += "C"
		}
	}
	println("${result}")
}