let readString() = stdin.ReadLine()
let readStringArray() = stdin.ReadLine().Split(' ');
let readInt() = readString() |> int
let readIntArray() = readStringArray() |> Array.map(fun x -> int x)
let char2String(value) = List.ofSeq value |> List.toArray |> System.String

let b = readString()

match b with 
| "A" -> "T"
| "T" -> "A"
| "C" -> "G"
| "G" -> "C"
| _ -> ""
|> printfn "%s"