import Control.Monad
import Data.Bool
import Data.List

readInt = readLn :: IO Int
readInts = map read . words <$> getLine :: IO [Int]
readNInts = flip replicateM readInts

main :: IO ()
main = do
  b <- getLine
  putStrLn $ f b

f "A" = "T"
f "T" = "A"
f "C" = "G"
f "G" = "C"