size = STDIN.gets.to_i
$ary1 = STDIN.gets.split.map(&:to_i)
$ary2 = STDIN.gets.split.map(&:to_i)

def dist(n)
  $ary1.zip($ary2).reduce(0){|sum, a| sum + (a[0] - a[1]).abs ** n} ** (1 / n)
end

puts "%.8f" % dist(1.0)
puts "%.8f" % dist(2.0)
puts "%.8f" % dist(3.0)

puts "%.8f" % $ary1.zip($ary2).map{|a| (a[0] - a[1]).abs }.max