d1 :: [Float] -> [Float] -> Float
d1 [] [] = 0
d1 (x : xs) (y : ys) = abs (x - y) + d1 xs ys

d2 :: [Float] -> [Float] -> Float
d2 [] [] = 0
d2 (x : xs) (y : ys) = (x - y)^2 + d2 xs ys

d3 :: [Float] -> [Float] -> Float
d3 [] [] = 0
d3 (x : xs) (y : ys) = (abs (x - y))^3 + d3 xs ys

dinf :: [Float] -> [Float] -> [Float]
dinf [] [] = []
dinf (x : xs) (y : ys) = abs (x - y) : dinf xs ys


main = getContents >>= mapM_ print . (\[x,y] -> [d1 x y, sqrt (d2 x y), (d3 x y)**recip 3, maximum $ dinf x y]) . map (map read . words) . tail . lines