import Numeric

showF f = showFFloat Nothing f ""
readNums = fmap (map read . words) getLine

infinity = read "Infinity"

minkowskiDistance :: (RealFloat a, Floating a, Ord a) => a -> [a] -> [a] -> a
minkowskiDistance p xs ys | isInfinite p =
  maximum $ map abs $ zipWith (-) xs ys
                          | otherwise =
  (sum [(abs a)**p | a <- zipWith (-) xs ys]) ** (1/p)

main = do
  _ <- getLine
  xs <- readNums
  ys <- readNums
  putStrLn $ showF $ xs `manhattanDistance` ys
  putStrLn $ showF $ xs `euclidDistance` ys
  putStrLn $ showF $ minkowskiDistance 3 xs ys
  putStrLn $ showF $ xs `chebyshevDistance` ys
    where
      manhattanDistance = minkowskiDistance 1
      euclidDistance = minkowskiDistance 2
      chebyshevDistance = minkowskiDistance infinity