gets
x = gets.split.map &:to_i
y = gets.split.map &:to_i
d = []
x.each_with_index{|e, i|
  d[i] = (e - y[i]).abs
}
puts d.inject :+
puts d.inject(0){|s, n| s + n*n} ** 0.5
puts d.inject(0){|s, n| s + n*n*n} ** (1.0 / 3)
puts d.max