import Control.Applicative

import Data.List
    (intersperse)
    
import Text.Printf
    (printf)
    
type Vector = [Double]

type Problem = (Vector, Vector)

type Result = [Double]

minkowski :: Vector -> Vector -> Double -> Double

minkowski xs ys p
    = sum ss ** (1 / p) where
        ds = map abs $ zipWith (-) xs ys
        ss = map (** p) ds
        
chebyshev :: Vector -> Vector -> Double

chebyshev xs ys
    = maximum $ map abs $ zipWith (-) xs ys

solve :: Problem -> Result

solve (xs, ys)
    = map (minkowski xs ys) [1, 2, 3] ++ [chebyshev xs ys]

output :: Result -> String

output result
    = concat $ intersperse "\n" $ map (printf "%.6f") result
    
input :: IO Problem

input
    = do
        getLine
        xs <- map read.words <$> getLine
        ys <- map read.words <$> getLine
        return (xs, ys)

main :: IO ()

main
    = putStr.output =<< solve <$> input