def d(xs, ys, p)
  if p == Float::INFINITY
    xs.map.with_index {|x, i| (x - ys[i]).abs}.max
  else
    sum = 0
    xs.each.with_index do |x, i|
      sum += (x - ys[i]).abs ** p
    end
    sum ** (1.0 / p)
  end
end

gets
xs = gets.split.map(&:to_i)
ys = gets.split.map(&:to_i)

puts sprintf '%.6f', d(xs, ys, 1)
puts sprintf '%.6f', d(xs, ys, 2)
puts sprintf '%.6f', d(xs, ys, 3)
puts sprintf '%.6f', d(xs, ys, Float::INFINITY)