import scala.collection.immutable.Map
import scala.io.StdIn._

object Main{
  type UnitedStateOfAmerica = Map[Char, Char]
  val Data : UnitedStateOfAmerica = Map('A' -> 'T', 'T' -> 'A', 'C' -> 'G', 'G' -> 'C')
  def main(args: Array[String]): Unit ={
    val cr : Char = readChar()
    println(Data(cr))
  }
}