import Control.Monad
import Control.Applicative

main :: IO ()
main = do
	n <- readLn :: IO Int
	lines <- replicateM 2 getLine
	let xs = map read $ words (lines !! 0) :: [Double]
	let ys = map read $ words (lines !! 1) :: [Double]
	let ds = zipWith (-) xs ys
	
	let p1 = sum $ map abs ds
	let p2 = (** (1/2)) $ sum $ map (** 2) ds
	let p3 = (** (1/3)) $ sum $ map (\x -> (abs x) ** 3) ds
	let pinf = foldr1 max $ map abs ds
	
	putStrLn $ show p1
	putStrLn $ show p2
	putStrLn $ show p3
	putStrLn $ show pinf