def calc_p_1_minkowski(n, x, y)
  p_1_minkowski = 0
  length = x.length
  for i in 0..(length-1)
    p_1_minkowski += (x[i] - y[i]).abs
  end
  return p_1_minkowski
end

def calc_p_2_minkowski(n, x, y)
  tmp = 0
  length = x.length
  for i in 0..(length-1)
    tmp += ((x[i] - y[i]).abs)**2
  end
  p_2_minkowski = tmp**(1/2.0)
  return p_2_minkowski
end

def calc_p_3_minkowski(n, x, y)
  tmp = 0
  length = x.length
  for i in 0..(length-1)
    tmp += ((x[i] - y[i]).abs)**3
  end
  p_3_minkowski = tmp**(1/3.0)
  return p_3_minkowski
end

def calc_p_inf_minkowski(n, x, y)
  length = x.length
  xy_array = []
  for i in 0..(length-1)
    xy_array.push((x[i]-y[i]).abs)
  end
  p_inf_minkowski = xy_array.max
  return p_inf_minkowski
end

n = gets.chomp.to_i
x = gets.chomp.split.map(&:to_i)
y = gets.chomp.split.map(&:to_i)

puts calc_p_1_minkowski(n, x, y)
puts calc_p_2_minkowski(n, x, y).round(6)
puts calc_p_3_minkowski(n, x, y).round(6)
puts calc_p_inf_minkowski(n, x, y)