import Control.Applicative
import Control.Monad
import Data.Array
import Data.Array.ST
import Data.Char
import Data.List
import qualified Data.Map as M
import qualified Data.Set as S
import Text.Printf

readInts :: IO [Int]
readInts = map read . words <$> getLine

main :: IO ()
main = do
  void getLine
  xs <- map read . words <$> getLine
  ys <- map read . words <$> getLine
  print $ minkowski 1 xs ys 
  print $ minkowski 2 xs ys 
  print $ minkowski 3 xs ys 
  print $ chebyshev xs ys 

minkowski :: Double -> [Double] -> [Double] -> Double
minkowski p = ((** (1/p)) . sum . map (** p)) `dot` zipWith dist

chebyshev :: [Double] -> [Double] -> Double
chebyshev = maximum `dot` zipWith dist

dist :: Double -> Double -> Double
dist x y = abs $ x - y

dot :: (c -> d) -> (a -> b -> c) -> a -> b -> d
dot = ((.).(.))

