import Control.Applicative
main = do _ <- getLine
          xs <- map read . words <$> getLine
          ys <- map read . words <$> getLine
          let d1 = dis 1.0 xs ys
              d2 = dis 2.0 xs ys
              d3 = dis 3.0 xs ys
              d  = maximum [abs(x-y) | (x,y) <- zip xs ys]
          putStr . unlines . map show $ [d1,d2,d3,d]

dis :: Double -> [Double] -> [Double] -> Double
dis n xs ys = (sum [(abs(x-y))**n | (x,y) <- zip xs ys])**(1/n)