import Control.Applicative
import Text.Printf

mdist :: Floating a => [a] -> [a] -> a -> a
mdist xs ys p = sum [abs (x - y) ** p | (x, y) <- zip xs ys] ** (1 / p)

cdist :: (Floating a, Ord a) => [a] -> [a] -> a
cdist xs ys = maximum [abs (x - y) | (x, y) <- zip xs ys]

main :: IO ()
main = do
    _ <- getLine
    xs <- (map (read :: String -> Double) . words) <$> getLine
    ys <- (map (read :: String -> Double) . words) <$> getLine
    ((\[p1, p2, p3] -> printf "%.6f\n%.6f\n%.6f\n" p1 p2 p3) . map (mdist xs ys)) [1.0, 2.0, 3.0]
    printf "%.6f\n" (cdist xs ys)