import Text.Printf

main :: IO ()
main = do
    getLine
    vectX <- fmap (map read . words) getLine
    vectY <- fmap (map read . words) getLine
    mapM_ (printf "%.6f\n" . minkowski vectX vectY) ps
    where ps = [1, 2, 3, read "Infinity"]

minkowski :: [Double] -> [Double] -> Double -> Double
minkowski xs ys p
    | isInfinite p = maximum [abs (x-y)  | (x,y) <- zip xs ys]
    | otherwise    = sum [abs (x-y) ** p | (x,y) <- zip xs ys] ** (1/p)
