readInt x = read x :: Int
readDouble x = read x :: Double

manhattan 0 xs ys = 0
manhattan n (x:xs) (y:ys) = abs (x - y) + manhattan (n - 1) xs ys

euclidSub 0 xs ys = 0
euclidSub n (x:xs) (y:ys) = (x - y)^2 + euclidSub (n - 1) xs ys
euclid n xs ys = sqrt $ euclidSub n xs ys

mincowskiSub p 0 xs ys = 0
mincowskiSub p n (x:xs) (y:ys) = (x - y)^p + mincowskiSub p (n - 1) xs ys
mincowski p n xs ys = (mincowskiSub p n xs ys) ** (1 / (fromIntegral p :: Double))

mincowskiMax xs ys = maximum $ zipWith (\x y -> abs (x - y)) xs ys

main = do
  n <- readLn
  x <- return . map readDouble . words =<< getLine
  y <- return . map readDouble . words =<< getLine
  print $ manhattan n x y
  print $ euclid n x y
  print $ mincowski 3 n x y
  print $ mincowskiMax x y