def mincof_distance(n:0,vec1:[],vec2:[])
    if n >= 4
        total = []
        vec1.length.times do |num|
            total.push((vec1[num]-vec2[num]).abs)
        end
        return total.max
    else
        total = 0
        vec1.length.times do |num|
            total += ((vec1[num]-vec2[num]).abs)**n
        end
        return total**(1.0/n)
    end
end

_ = gets
v1 = gets.split.map(&:to_f)
v2 = gets.split.map(&:to_f)
puts "#{sprintf("%.5f",mincof_distance(n:1,vec1:v1,vec2:v2))}"
puts "#{sprintf("%.5f",mincof_distance(n:2,vec1:v1,vec2:v2))}"
puts "#{sprintf("%.5f",mincof_distance(n:3,vec1:v1,vec2:v2))}"
puts "#{sprintf("%.5f",mincof_distance(n:4,vec1:v1,vec2:v2))}"
