import Control.Applicative

manhattanDistance :: [Int] -> [Int] -> Double
manhattanDistance x y = realToFrac $ sum $ map abs $ zipWith (-) x y

euclideanDistance :: [Int] -> [Int] -> Double
euclideanDistance x y = sqrt $ realToFrac $ sum $ map (^2) $ zipWith (-) x y

chebyshevDistance :: [Int] -> [Int] -> Double
chebyshevDistance x y = realToFrac $ maximum $ map abs $ zipWith (-) x y

thirdMinkowskiDistance :: [Int] -> [Int] -> Double
thirdMinkowskiDistance x y = (** (1.0/3.0) ) $ realToFrac $ sum $ map ((^3) . abs) $ zipWith (-) x y

main = do{
    n <- getLine;
    x <- map (read::String->Int) . words <$> getLine;
    y <- map (read::String->Int) . words <$> getLine;
    putStrLn $ show $ manhattanDistance x y;
    putStrLn $ show $ euclideanDistance x y;
    putStrLn $ show $ thirdMinkowskiDistance x y;
    putStrLn $ show $ chebyshevDistance x y;
}