import Control.Applicative
import Data.Function
import Control.Monad
import Data.List
import Data.Char
import Text.Printf

md :: Double -> [Double] -> [Double] -> Double
md p xs ys = (sum $ zipWith (\x y -> (abs (x-y))**p) xs ys) ** (1/p)

md' :: [Double] -> [Double] -> Double
md' xs ys = maximum $ zipWith (\x y -> abs (x-y)) xs ys

main :: IO ()
main = do
    _ <- getLine
    xs <- map read . words <$> getLine
    ys <- map read . words <$> getLine
    forM_ [1,2,3] $ \i ->
        printf "%.10f\n" $ md i xs ys
    printf "%.10f\n" $ md' xs ys
