gets
x = gets.split.map(&:to_f)
y = gets.split.map(&:to_f)
puts x.zip(y).inject(0) { |sum, (a,b)| sum += (a - b).abs }
puts Math.sqrt x.zip(y).inject(0) { |sum, (a,b)| sum += (a - b).abs ** 2 }
puts x.zip(y).inject(0) { |sum, (a,b)| sum += (a - b).abs ** 3 } ** (1.0 / 3.0)
a1,b1 = x.zip(y).max_by { |(a,b)| (a - b).abs }
puts (a1-b1).abs