module Main where

import Data.List
import Control.Monad
import Debug.Trace


main = do
    b <- getLine
    putStrLn $ case b of
        "A" -> "T"
        "T" -> "A"
        "C" -> "G"
        "G" -> "C"

