#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_10_D

def dist(x,y,n)
    
    if n > 0 
        sum=0.0
        for i in 0..x.size-1
            sum += ((x[i]-y[i]).abs)**n
        end
        sum **= (1.0/n)
    else
        sum=0.0
        for i in 0..x.size-1
            a = ((x[i]-y[i]).abs)
            sum = a if sum<a
        end
        sum
    end
    
end

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

for i in 1..3 do
    p dist(x,y,i)
end
    p dist(x,y,-1)