import math



def getDistance( x, y, n, p ):

	dxy = 0

	for i in range( n ):

		dxy += abs( x[i] - y[i] )**p

	return dxy**(1/float( p ) )





n = int( eval(input()) )

x = [ float( i ) for i in input( ).split( " " ) ]

y = [ float( i ) for i in input( ).split( " " ) ]

print(( getDistance( x, y, n, 1 ) ))

print(( getDistance( x, y, n, 2 ) ))

print(( getDistance( x, y, n, 3 ) ))

dxy = [ 0 ]*(n+1)

for i in range( n ):

	dxy[i] = abs( x[i] - y[i] )



print(( max( dxy ) ))
import math



n = int( eval(input()) )

x = [ float( val ) for val in input().split( ' ' ) ]

y = [ float( val ) for val in input().split( ' ' ) ]



Dxy = Dxy2 = Dxy3 = Dxyp = 0

for i in range( n ):

	t = abs(x[i]-y[i])

	Dxy += t

	Dxy2 += t**2

	Dxy3 += t**3

	Dxyp = max( Dxyp, t )

print( Dxy )

print(( Dxy2**(1/2) ))

print(( Dxy3**(1/3) ))

print( Dxyp )



import math


def getDistance(x, y, n, p):
    dxy = 0
    for i in range(n):
        dxy += abs(x[i] - y[i]) ** p
    return dxy ** (1 / float(p))


n = int(eval(input()))
x = [float(i) for i in input().split(" ")]
y = [float(i) for i in input().split(" ")]
print((getDistance(x, y, n, 1)))
print((getDistance(x, y, n, 2)))
print((getDistance(x, y, n, 3)))
dxy = [0] * (n + 1)
for i in range(n):
    dxy[i] = abs(x[i] - y[i])
print((max(dxy)))

import math

n = int(eval(input()))
x = [float(val) for val in input().split(" ")]
y = [float(val) for val in input().split(" ")]
Dxy = Dxy2 = Dxy3 = Dxyp = 0
for i in range(n):
    t = abs(x[i] - y[i])
    Dxy += t
    Dxy2 += t**2
    Dxy3 += t**3
    Dxyp = max(Dxyp, t)
print(Dxy)
print((Dxy2 ** (1 / 2)))
print((Dxy3 ** (1 / 3)))
print(Dxyp)

- -def getDistance(x, y, n, p): -    dxy = 0 -    for i in range(n): -        dxy += abs(x[i] - y[i]) ** p -    return dxy ** (1 / float(p)) - - -x = [float(i) for i in input().split(" ")] -y = [float(i) for i in input().split(" ")] -print((getDistance(x, y, n, 1))) -print((getDistance(x, y, n, 2))) -print((getDistance(x, y, n, 3))) -dxy = [0] * (n + 1) +x = [float(val) for val in input().split(" ")] +y = [float(val) for val in input().split(" ")] +Dxy = Dxy2 = Dxy3 = Dxyp = 0 -    dxy[i] = abs(x[i] - y[i]) -print((max(dxy))) +    t = abs(x[i] - y[i]) +    Dxy += t +    Dxy2 += t**2 +    Dxy3 += t**3 +    Dxyp = max(Dxyp, t) +print(Dxy) +print((Dxy2 ** (1 / 2))) +print((Dxy3 ** (1 / 3))) +print(Dxyp)