import Control.Monad
import Control.Applicative
import Data.Functor
import Data.List
import Data.Char

dist p xs ys = (**(1/p)) . sum . map ((**p) . abs) $ zipWith (-) xs ys
distInf xs ys = maximum $ zipWith (-) xs ys

main = do
  getLine
  xs <- map read . words <$> getLine
  ys <- map read . words <$> getLine
  print $ dist 1 xs ys
  print $ dist 2 xs ys
  print $ dist 3 xs ys
  print $ distInf xs ys