n = gets.chomp.to_i
a = gets.chomp.split.map(&:to_f)
b = gets.chomp.split.map(&:to_f)

def distance(a, b, p)
  return (a.zip(b).inject(0){|result, item| result + (item.inject(:-).abs)**p}) ** (1.0/p)
end

def chibishefu(a, b)
  return a.zip(b).map{|item| item.inject(:-).abs}.max
end

puts distance(a,b,1)
puts distance(a,b,2)
puts distance(a,b,3)
puts chibishefu(a,b)