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

def p_dist(x,y,p)
  x.zip(y).reduce(0){|t, (x_i, y_i)|
    t + (x_i - y_i).abs ** p
  } ** (1/p.to_f)
end

puts p_dist(x,y,1)
puts p_dist(x,y,2)
puts p_dist(x,y,3)
puts x.zip(y).map{|(x_i, y_i)| (x_i - y_i).abs}.max
