import Text.Printf

d x y p = (**(1/p)) . sum . map ((**p).abs) $ zipWith (-) x y

d_chebyshev x y = maximum . map abs $ zipWith (-) x y

main :: IO ()
main = do
    _ <- getLine
    x <- getLine >>= return.(map (\n -> read n :: Double)).words
    y <- getLine >>= return.(map (\n -> read n :: Double)).words

    printf "%.6f\n" $ d x y 1
    printf "%.6f\n" $ d x y 2
    printf "%.6f\n" $ d x y 3
    printf "%.6f\n" $ d_chebyshev x y

