import Numeric
data Infinitable a = Infinite | Regular a deriving (Show, Eq)

minkowskiDistance :: RealFloat a => Infinitable a -> (a, a) -> a -> a
minkowskiDistance (Regular p) (x1, y1) d = ((abs $ x1 - y1) ** p + d ** p) ** (1 / p)
minkowskiDistance Infinite (x1, y1) d = max (abs $ x1 - y1) d

myShow :: RealFloat a => a -> String
myShow f = showFFloat Nothing f ""

main :: IO ()
main = do
  n <- getLine
  xs <- fmap (map read . words) getLine
  ys <- fmap (map read . words) getLine
  let xys = zip xs ys
  let dists = [foldr (minkowskiDistance p) 0 xys | p <- [Regular 1,Regular 2,Regular 3,Infinite]]
  mapM_ putStrLn $ map myShow dists