import java.util.Scanner

object Main {
  val sc = new Scanner(System.in)
  def main(args: Array[String]): Unit = {
    val b = sc.next
    val res = b.split("(?<=.)").map{ str =>
      str match{
        case "A" => "T"
        case "C" => "G"
        case "G" => "C"
        case "T" => "A"
      }
    }
    res.foreach(print)
    println

  }

}