area :: (Num a) => a -> a -> a
area = \x y -> x * y

perimeter :: (Num a) => a -> a -> a
perimeter = \x y -> 2 * x + 2 * y

printf :: (Show a) => [a] -> IO ()
printf xs = putStrLn $ unwords $ map show xs   

main = do
  hoge <- getLine
  let  a = head $ words hoge
       b = last $ words hoge
       ar = area (read a) (read b)
       per = perimeter (read a) (read b)
  printf [ar, per]
