import Control.Monad
import Text.Printf

getLines :: Int -> IO [String]
getLines n = replicateM n getLine

getLinesInt :: Int -> IO [Int]
getLinesInt n = fmap read <$> getLines n

getInts :: IO [Int]
getInts = map (read :: String -> Int) . words <$> getLine

getDoubles :: IO [Double]
getDoubles = map (read :: String -> Double) . words <$> getLine

main :: IO ()
main = do
    [b] <- getLine
    putChar $ case b of 'A' -> 'T'
                        'T' -> 'A'
                        'C' -> 'G'
                        'G' -> 'C'


