import           Control.Applicative
import           Control.Monad
import           Data.List

main :: IO ()
main = do
  [n,xs,ys] <- take 3 . map ( map (read::String->Double) . words) . lines <$> getContents
  putStr $ unlines $ map (show . minkowski xs ys) [1,2,3]
  print $ chebyshev xs ys
    where
      minkowski::[Double]->[Double]->Int->Double
      minkowski xs ys p = (sum $ zipWith (\x y -> (abs (x-y))^p ) xs ys)**(1.0/fromIntegral p)
      chebyshev xs ys = maximum $ zipWith (\x y -> abs (x-y)) xs ys
