import Control.Monad import Control.Monad.ST import Control.Monad.State (StateT (..), modify') import Data.Char (isSpace) import Data.Coerce (coerce) import Data.Word (Word8) import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as BSC8 import qualified Data.Vector.Unboxed as VU main :: IO () main = do n <- readLn :: IO Int ps <- parseN1 n putStr . unlines . map show . VU.toList $ solver ps solver :: VU.Vector Int -> VU.Vector Int solver qs = runST $ VU.forM qs $ \p -> if p == 1 then return 2 else return $ p * p ------------------------------------------------------------------------------- -- Input ------------------------------------------------------------------------------- type CParser a = StateT BSC8.ByteString Maybe a runCParser :: CParser a -> BSC8.ByteString -> Maybe (a, BSC8.ByteString) runCParser = runStateT {-# INLINE runCParser #-} int :: CParser Int int = coerce $ BSC8.readInt . BSC8.dropWhile isSpace {-# INLINE int #-} int1 :: CParser Int int1 = fmap (subtract 1) int {-# INLINE int1 #-} parseN1 :: Int -> IO (VU.Vector Int) parseN1 n = VU.unfoldrN n (runCParser int1) <$> BSC8.getContents {-# INLINE parseN1 #-}