import Text.Printf

main = do
    s1 <- getLine
    s2 <- getLine
    s3 <- getLine
    
    let xs = map (\x -> read x :: Double) $ words s2
    let ys = map (\x -> read x :: Double) $ words s3
    
    printf "%.8f\n" (dist 1 xs ys)
    printf "%.8f\n" (dist 2 xs ys)
    printf "%.8f\n" (dist 3 xs ys)
    printf "%.8f\n" (distInf xs ys)

dist p xs ys = (**(1/p)) $ sum $ zipWith (\x y -> (abs $ x-y) ** p) xs ys
distInf xs ys = maximum $ map (\(x,y) -> abs $ x-y) $ zip xs ys
