pn n xs ys = (**(1/(fromInteger n))) . fromInteger . foldr ((+) . (\(x,y) -> (abs (x-y))^n)) 0 $ zip xs ys
p1 xs ys = pn 1 xs ys
p2 xs ys = pn 2 xs ys
p3 xs ys = pn 3 xs ys
pI xs ys = maximum $ zipWith (\x y -> abs (x-y)) xs ys

main = do
  _ <- getLine
  xs <- fmap (map read . words) getLine
  ys <- fmap (map read . words) getLine


  print $ p1 xs ys
  print $ p2 xs ys
  print $ p3 xs ys
  print $ pI xs ys
