[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.map f

[<EntryPoint>]
let main argv =
    match read id with
    | "A" -> "T"
    | "T" -> "A"
    | "C" -> "G"
    | "G" -> "C"
    |> printfn "%s"
    0