gets
x = gets.split.map(&:to_f)
y = gets.split.map(&:to_f)

def distance(x, y, p)
	sum = x.size.times.map{|i|(x[i] - y[i]).abs ** p}.inject(:+)
	sum ** (1.0/p)
end

puts distance(x, y, 1)
puts distance(x, y, 2)
puts distance(x, y, 3)
puts x.size.times.map{|i|(x[i]-y[i]).abs}.max