def distance_n(x, y, p)
    d = 0.0
    x.length.times { |i|
        d += ((x[i]-y[i]).abs**p)
    }
    d**(1/p)
end

def distance_i(x, y)
    d = 0.0
    x.length.times { |i|
        du = (x[i]-y[i]).abs
        d = du if du > d
    }
    d
end

n = gets.to_i
x = gets.chomp.split(" ").map &:to_f
y = gets.chomp.split(" ").map &:to_f

3.times{ |i| puts distance_n(x, y, (i+1).to_f) }
puts distance_i(x, y)