def pr(f)
  printf "%f\n",f
end
def calc(v1,v2,iN,iP)
  beki=iP
  beki=1 if iP==4
  arr=[]
  iN.times do |i|
    arr << (v1[i]-v2[i]).abs ** beki
  end
  return case iP
         when 1; arr.sum
         when 2; Math.sqrt(arr.sum)
         when 3; arr.sum ** (1.0/3.0)
         when 4; arr.max
         end
end
def code_run
  iN=$stdin.gets.to_i
  v1=$stdin.gets.split.map(&:to_i)
  v2=$stdin.gets.split.map(&:to_i)
  (1..4).each do |n|
    pr calc(v1,v2,iN,n)
  end
end

code_run
