Problem:
 Score : 100 points    Problem Statement You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0 .  Then, just after completing the i -th task, you can complete the j -th task at cost |A_j - A_i| .  Here, |x| denotes the absolute value of x .  Find the minimum total cost required to complete all the task.      Constraints  All values in input are integers.  1 \leq A_1, A_2, A_3 \leq 100         Input Input is given from Standard Input in the following format:  A_1  A_2  A_3       Output Print the minimum total cost required to complete all the task.        Sample Input 1 1 6 3      Sample Output 1 5  When the tasks are completed in the following order, the total cost will be 5 , which is the minimum:   Complete the first task at cost 0 .  Complete the third task at cost 2 .  Complete the second task at cost 3 .        Sample Input 2 11 5 5      Sample Output 2 6       Sample Input 3 100 100 100      Sample Output 3 0

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    a = sorted(map(int, input().split()))
    print(sum(a[1:]) - sum(a[:2]))


if __name__ == "__main__":
    main()

Solution (Python):
L = list(map(int, input().split()))
L.sort()
S = []
for i in range(1,3):
  S.append(L[i]-L[i-1])
print(sum(S))

Solution (Python):
A = list(map(int,input().split()))
print(max(A)-min(A))

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    a = list(map(int, input().rstrip('\n').split()))
    a.sort()
    t = 0
    for i in range(1, len(a)):
        t += abs(a[i] - a[i-1])
    print(t)


if __name__ == '__main__':
    slove()

Solution (Python):
A = list(map(int, input().split()))
print(max(A) - min(A))

Solution (Python):
*a,=map(int,input().split())
print(max(a)-min(a))

Solution (Python):
a = list(map(int,input().split()))
a.sort()
print(a[2]-a[0])

Solution (Python):
a = sorted(list(map(int, input().split())), reverse=True)

print(a[0] - a[1] + a[1] - a[2])

Solution (Python):
A = list(map(int, input().split()))
A.sort()
print(A[2] - A[0])

Solution (Python):
A = sorted(map(int, input().split()))

print(A[2] - A[0])

Solution (Python):
l = list(map(int, input().split()))
l = sorted(l)
c = 0
for i in range(len(l)):
  if i > 0:
    c += abs(l[i-1]-l[i])
print(c)

Solution (Python):
a,b,c=(map(int,input().split()))
s=[abs(a-b),abs(a-c),abs(b-c)]
s.sort()
print(s[0]+s[1])

Solution (Python):
X = sorted(list(map(int, input().split())))
print(X[-1]-X[0])

Solution (Python):
A=list(map(int, input().split()))
A.sort()
print(A[2]-A[0])

Solution (Python):
A,B,C=map(int,input().split())
print(max(A,B,C)-min(A,B,C))

Solution (Python):
A1,A2,A3 = sorted(map(int,input().split()))

print(( A3 - A2 ) + ( A2 -A1 ))

Solution (Python):

def resolve():
  a, b, c = map(int, input().split())
  ans = 1000
  if ans > abs(b - a) + abs(c - b):
    ans = abs(b - a) + abs(c - b)

  if ans > abs(c - b) + abs(a - c):
    ans = abs(c - b) + abs(a - c)

  if ans > abs(a - c) + abs(b - a):
    ans = abs(a - c) + abs(b - a)

  print(ans)


if __name__ == "__main__":
  resolve()

Solution (Python):
a, b, c = map(int, input().split());print(max(a,b,c)-min(a,b,c))

Solution (Python):

a = map(int, input().split())
a = sorted(a)
print(0 + (a[1] - a[0]) + (a[2] - a[1]))

Solution (Python):
ls=[int(s) for s in input().split()]
ls.sort()
print(ls[2]-ls[0])

Solution (Python):
a = list(map(int, input().split()))
b = [abs(a[0]-a[1]), abs(a[1]-a[2]), abs(a[2]-a[0])]
b.sort()
print(b[0]+b[1])

Solution (Python):
A1,A2,A3 = map(int,input().split())
a = abs(A2-A1)
b = abs(A3-A2)
c = abs(A1-A3)
print(min(a+b,b+c,c+a))

Solution (Python):
a1,a2,a3 = input().split(" ")
a1 = int(a1)
a2 = int(a2)
a3 = int(a3)
l = [a1,a2,a3]
jl = []

for i in range(3):
  jl.append(abs(l[(i+1)%3]-l[i%3]) + abs(l[(i+1)%3]-l[(i+2)%3]))
  jl.append(abs(l[(i+2)%3]-l[i%3]) + abs(l[(i+1)%3]-l[(i+2)%3]))


print(min(jl))

Solution (Python):
a, b, c = sorted(map(int, input().split()))
print(c-a)

Solution (Python):
cost=list(map(int,input().split()))
cost.sort()
print(cost[2] - cost[0])

Solution (Python):
a = list(map(int, input().split()))
a.sort()
print(a[2]-a[1]+a[1]-a[0])

Solution (Python):
a = list(map(int, input().split()))
a.sort()
print(abs(a[2]-a[1])+abs(a[1]-a[0]))

Solution (Python):
a_l=list(map(int,input().split()))

print(max(a_l)-min(a_l))

Solution (Python):
A1,A2,A3=map(int,input().split())
A_1=abs(A1-A2)+abs(A2-A3)
A_2=abs(A1-A3)+abs(A2-A3)
A_3=abs(A1-A2)+abs(A1-A3)
print(min(A_1,A_2,A_3))

Solution (Python):
A1,A2,A3=map(int,input().split())
A=[A1,A2,A3]
A.append(A1)
def A_(i):
    if A[i]-A[i+1]>=0:
        return A[i]-A[i+1]
    else:
        return A[i+1]-A[i]
B=[A_(i) for i in range(3)]
B.append(A_(0))
B.append(A_(1))
def sum(j):
    return B[j]+B[j+1]
C=[sum(j) for j in range(3)]
print(min(C))

Solution (Python):
A=list(map(int,input().split()))
a=abs(A[0]-A[1])
b=abs(A[1]-A[2])
c=abs(A[2]-A[0])
print(a+b+c-max(a,b,c))

Solution (Python):

a = list(map(int, input().split()))
cost = [abs(a[0]-a[1]), abs(a[1]-a[2]), abs(a[2]-a[0])]
print(sum(cost)-max(cost))

Solution (Python):
a = list(map(int, input().split()))

print(max(a) - min(a))

Solution (Python):
AAA = sorted(list(map(int,input().split())))
print(AAA[2]-AAA[0])

Solution (Python):
a=list(map(int, input().split()))
a.sort()
print(abs(a[0]-a[1]) + abs(a[1]-a[2]))

Solution (Python):
a, b, c = sorted(map(int, input().split()))
print(c-a)

Solution (Python):
AList = list(map(int,input().split()))
AList.sort()
print(abs(AList[0]-AList[1])+abs(AList[2]-AList[1]))

Solution (Python):
A = [int(x) for x in input().split()]
A.sort()
print(abs(A[1]-A[0])+abs(A[2]-A[1]))

Solution (Python):
a, b, c = sorted(map(int, input().split()))

print(c-a)

Solution (Python):
a,b,c=map(int,input().split())
print(max(a,b,c)-min(a,b,c))

Solution (Python):
a= list(map(int,input().split()))
print(max(a)- min(a))

Solution (Python):
L=list(map(int,input().split()))
L.sort()
a=0
for i in range(1,len(L)):
    a=a+(L[i]-L[i-1])
    
print(a)

Solution (Python):
A1,A2,A3=map(int,input().split())
c=[A1,A2,A3]
S=max(c)
Z=min(c)
print(S-Z)

Solution (Python):
import math
A = list(map(int, input().split()))

A.sort()
print(abs(A[1]-A[0])+ abs(A[2]-A[1]))

Solution (Python):
a, b, c = map(int, input().split())
l = sorted([abs(a - b), abs(b - c), abs(c - a)])
print(l[0] + l[1])

Solution (Python):
a = list(map(int, input().split()))
a.sort()
print(a[1] - a[0] + a[2] - a[1])

Solution (Python):
from itertools import permutations
A = list(map(int, input().split()))

res = float("inf")
for a,b,c in permutations(A):
    res = min(res, abs(a-b) + abs(b-c))
print(res)

Solution (Python):
A = [int(i) for i in input().split()]
print(max(A)-min(A))

Solution (Python):
a,b,c=map(int,input().split())
print(min(abs(a-b)+abs(b-c),abs(b-c)+abs(c-a),abs(c-a)+abs(a-b)))

Solution (Python):
A, B, C = map(int, input().split())

ans = min(
    abs(A - B) + abs(B - C),
    abs(A - C) + abs(B - C),
    abs(B - A) + abs(A - C),
    abs(B - C) + abs(A - C),
    abs(C - A) + abs(A - B),
    abs(C - B) + abs(A - B),
)

print(ans)

Solution (Python):

a = list(map(int,input().split()))
print(max(a)-min(a))

Solution (Python):

def main():
    A = sorted(map(int, input().split()))
    ans = A[2] - A[0]
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
arr = [int(x) for x in input().split()]
sorted_arr = sorted(arr)
print(sorted_arr[2]-sorted_arr[0])

Solution (Python):
A=list(map(int,input().split()))
A.sort()
T=0
for i in range(2):
    T+=A[i+1]-A[i]
print(T)

Solution (Python):
a = list(map(int, input().split()))
b = [0]*3
b[0]= abs(a[0]-a[1])
b[1]= abs(a[0]-a[2])
b[2]= abs(a[1]-a[2])
b.sort()
print(b[0]+b[1])

Solution (Python):
A1,A2,A3 = sorted(map(int,input().split()))
print(A3-A1)

Solution (Python):




def main():

    A = list(map(int,input().split()))
    A.sort()
    print(A[1]-A[0]+A[2]-A[1])




if __name__ == "__main__":
    main()

Solution (Python):
a,b,c = list(map(int,input().split()))

print(max(a,b,c)-min(a,b,c))

Solution (Python):
*a,=map(int,input().split())
print(max(a)-min(a))

Solution (Python):
a = list(map(int, input().split()))
print(abs(max(a) - min(a)))

Solution (Python):
a, b, c = map(int, input().split())
def formula(x, y, z):
    return abs(x-y)+abs(y-z)

kumi = [ [a,b,c], [b,a,c], [c, a, b], [a,c,b], [b,c,a], [c,b,a]]
print(min([formula(i, j, k) for i,j,k in kumi]))

Solution (Python):
import itertools

ls = list(map(int, input().split()))
res = []
for a0, a1, a2 in itertools.permutations(ls):
    res.append(abs(a0 - a1) + abs(a1 - a2))
print(min(res))

Solution (Python):
x = list(map(int, input().split()))

x.sort()

print(x[2] - x[0])

Solution (Python):
A = list(map(int,input().split()))
A.sort()
print(abs(A[0]-A[1])+abs(A[1]-A[2]))

Solution (Python):
nums = list(map(int, input().split()))
print(max(nums) - min(nums))

Solution (Python):
l = list(map(int,input().split()))
print(max(l)-min(l))

Solution (Python):
A = sorted(list(map(int, input().split())))
print(abs(A[0]-A[2]))

Solution (Python):
a = list(map(int, input().split()))
a.sort()
print(a[2] - a[0])

Solution (Python):
a = list(map(int, input().split()))
a.sort()
print(a[2] - a[0])

Solution (Python):
a, b, c = map(int, input().split())
a_b = abs(b-a)
a_c = abs(c-a)
b_c = abs(b-c)
print(a_b + a_c + b_c - max(a_b, a_c, b_c))

Solution (Python):
a1, a2, a3 = map(int, input().split())
case1 = abs(a1 - a2) + abs(a2 - a3)
case2 = abs(a1 - a3) + abs(a3 - a2)
case3 = abs(a2 - a1) + abs(a1 - a3)
print(min(case1, case2, case3))

Solution (Python):
a=sorted(map(int,input().split()))
print(a[2]-a[0])

Solution (Python):
*a,=map(int,input().split())
print(max(a)-min(a))

Solution (Python):
a = sorted(list(map(int, input().split())))
print(a[2] - a[0])

Solution (Python):
a=list(map(int,input().split()))
a=sorted(a)
print((a[1]-a[0])+(a[2]-a[1]))

Solution (Python):
*lis, = map(int, input().split())
print(max(lis) - min(lis))

Solution (Python):
task = list(map(int,input().split()))
task.sort(reverse = True)
print(task[0]-task[2])

Solution (Python):
s=list(input().split())
s.sort()
total=abs(int(s[2])-int(s[0]))

print(total)

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
l=list(map(int,input().split()))

ls=sorted(l)

print(ls[2]-ls[0])

Solution (Python):
A_list = list(map(int, input().split()))
A_list_sorted = sorted(A_list)

print(0 + abs(A_list_sorted[1] - A_list_sorted[0]) + abs(A_list_sorted[2] - A_list_sorted[1]))

Solution (Python):
a,b,c=sorted(map(int,input().split()));print(c-a)

Solution (Python):
a1,a2,a3 = map(int,input().split())
print(abs(a1-a2)+abs(a2-a3)+abs(a3-a1)-max(abs(a1-a2),abs(a2-a3),abs(a3-a1)))

Solution (Python):
a, b, c = sorted(map(int, input().split()))
print((b-a)+(c-b))

Solution (Python):
num = sorted([ int(i) for i in input().split() ])
print((num[2] - num[1]) + (num[1] - num[0]))

Solution (Python):
a=list(map(int, input().split()));print(max(a)-min(a))

Solution (Python):
a = list(map(int, input().split()))
print(abs(max(a)-min(a)))

Solution (Python):
box=list(map(int,input().split()))
box=sorted(box)
count=0
for i in range(len(box)-1):
    count +=abs(box[i+1]-box[i])
print(count)

Solution (Python):
a,b,c = map(int, input().split())
l = [abs(a-b),abs(b-c), abs(c-a)]
l.sort()
print(l[0] + l[1])

Solution (Python):
A = list(map(int,input().split()))
A = sorted(A)

print(A[-1] - A[0])

Solution (Python):
k = [int(x) for x in input().split()]
print(max(k)-min(k))

Solution (Python):
A=list(map(int, input().split()))
print(max(A)-min(A))

Solution (Python):
a,b,c=map(int,input().split())
print(max(a,b,c)-min(a,b,c))

Solution (Python):
a=list(map(int,input().split()))
print(max(a)-min(a))

Solution (Python):
a=list(map(int,input().split()))
print(max(a)-min(a))

Solution (Python):
A = sorted(list(map(int, input().split())))

print(A[2] - A[0])

Solution (Python):
L = sorted(map(int, input().split()))
print(L[2] - L[0])

Solution (Python):
L = sorted(map(int, input().split()), reverse=True)
print((L[0] - L[1]) + (L[1] - L[2]))

Solution (Python):
A = list(map(int, input().split()))
print(max(A) - min(A))

Solution (Python):
A = list(map(int, input().split()))
A.sort()

ans = 0
for i in range(1,3):
  ans += A[i] - A[i-1]
print(ans)

Solution (Python):
a_list = sorted(map(int, input().split()))
print(a_list[2]-a_list[0])

Solution (Python):
a1, a2, a3 = map(int, input().split())
a_list = sorted([a1,a2,a3])
print(a_list[2]-a_list[0])

Solution (Python):
A1,A2,A3 = map(int,input().split())

min_cost = abs(A1-A2)
if (min_cost < abs(A2-A3)) :
    min_cost = abs(A2-A3)

if (min_cost < abs(A1-A3)) :
    min_cost = abs(A1-A3)

print(min_cost)

Solution (Python):
l = list(map(int, input().split()))
l.sort()
print(l[2] - l[0])

Solution (Python):
a,b,c=sorted(map(int,input().split()))
print((c-b)+(b-a))

Solution (Python):
a = list(map(int, input().split()))
a.sort()
ans = a[-1]-a[0]
print(ans)

Solution (Python):
A = list(map(int,input().split()))
A.sort()
cnt = A[1]-A[0] + A[2]-A[1]
print(cnt)

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]

def code():
    a,b,c = map(int,input().split(' '))
    M = max(a,b,c)
    m = min(a,b,c)
    print(abs(M-m))

if __name__=='__main__':
    code()

Solution (Python):
a,b,c = map(int,input().split(' '))
M = max(a,b,c)
m = min(a,b,c)
print(abs(M-m))

Solution (Python):
def code():
    a,b,c = map(int,input().split(' '))
    M = max(a,b,c)
    m = min(a,b,c)
    print(abs(M-m))

if __name__=='__main__':
    code()

Solution (Python):
a = list(map(int, input().split()))

a.sort()

print(a[2] - a[0])

Solution (Python):
A = list(map(int,input().split()))
A.sort()
print(A[-1]-A[0])

Solution (Python):
a,b,c = map(int, input().strip().split(' '))
print(max(a,b,c)-min(a,b,c))

Solution (Python):
A = list(map(int, input().split()))
print(max(A) - min(A))

Solution (Python):
a1,a2,a3 = map(int,input().split())
list = [a1,a2,a3]
list.sort(reverse=True)
print((list[0] - list[1]) + (list[1] - list[2]))

Solution (Python):
A1, A2, A3 = map(int, input().split())
r = min(abs(A2-A1)+abs(A3-A2), abs(A3-A1)+abs(A2-A3), abs(A1-A2)+abs(A3-A1))
print(r)

Solution (Python):
def main(a: list):
    a = sorted(a)

    cost = 0

    cost += abs(a[0] - a[1])
    cost += abs(a[1] - a[2])

    return cost


if __name__ == '__main__':
    print(main(list(map(int, input().split(' ')))))

Solution (Python):
r=sorted(map(int,input().split()))[::-1]

print(r[0]-r[2])

Solution (Python):
a, b, c = map(int, input().split(" "))
l = list(map(abs, [a-b, a-c, b- c]))
print(sum(l) - max(l))

Solution (Python):
a, b, c = map(int,input().split())
print(min(abs(a-b)+abs(b-c), abs(b-c)+abs(c-a), abs(c-a)+abs(a-b)))

Solution (Python):
a=list(map(int,input().split()))
print(max(a)-min(a))

Solution (Python):
a, b, c = map(int, input().split())
tmp = [abs(a-b), abs(b-c), abs(c-a)]
print(sum(tmp) - max(tmp))

Solution (Python):
b = [int(_) for _ in input().split()]
if len(b) == 3:
    if 1 <= b[0] <= 100 and 1 <= b[1] <= 100 and 1 <= b[2] <= 100:
        b.sort()
        print(b[2]-b[0])
    else:
        print('hoge!')
else:
    print('hoge!')

Solution (Python):
num = input().split()
num = sorted([int(i) for i in num])
ans = 0
for i in range(1, 3):
  ans += num[i]-num[i-1]
print(ans)

Solution (Python):
a, b, c = map(int,input().split())
print(max(a,b,c)-min(a,b,c))

Solution (Python):
a = sorted(list(map(int,input().split())))
print(abs(a[2]- a[0] ))

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

li = na()
li.sort()
print(li[2] - li[0])

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

li = na()
li.sort()
print(li[2] - li[1] + li[1] - li[0])

Solution (Python):
aa = list(map(int,input().split()))
print(max(aa)-min(aa))

Solution (Python):
a, b, c = map(int, input().split())

print(max(abs(a-b), abs(b-c), abs(c-a)))

Solution (Python):
a,b,c=sorted(map(int,input().split()));print(c-b+b-a)

Solution (Python):
list = list(map(int,input().split()))
list.sort()
cost = [0]*3
for i in range(3):
	if i==0:
		cost[0] = 0
	else:
		cost[i] = list[i]-list[i-1]

print(sum(cost))

Solution (Python):
a = list(map(int,input().split()))
order = [[0,1,2],[0,2,1],[1,0,2],[1,2,0],[2,0,1],[2,1,0]]
ans = 10000000
for i in range(len(order)):
    cost = abs(a[order[i][1]] - a[order[i][0]]) + abs(a[order[i][2]] - a[order[i][1]])
    if(ans > cost):
        ans = cost
print(ans)

Solution (Python):
a,b,c = sorted(map(int,input().split()))
print(c-a)

Solution (Python):
a = list(map(int, input().split()))
print(min(abs(a[2] - a[1]) + abs(a[1] - a[0]),
          abs(a[1] - a[0]) + abs(a[2] - a[0]),
          abs(a[0] - a[1]) + abs(a[2] - a[0]),
          abs(a[2] - a[0]) + abs(a[1] - a[0]),
          abs(a[0] - a[1]) + abs(a[1] - a[2]),
          abs(a[0] - a[2]) + abs(a[2] - a[1])
))

Solution (Python):
a,b,c=sorted(map(int,input().split()))
print(c-a)

Solution (Python):
a,b,c = map(int,input().split())
print(max(abs(a-b),abs(b-c),abs(c-a)))

Solution (Python):
a = list(map(int, input().split()))

a.sort()

print(a[2] - a[0])

Solution (Python):

a = list(map(int, input().split()))
print(max(a)-min(a))

Solution (Python):
x = list(map(int, input().split()))
print(max(x) - min(x))

Solution (Python):
a,b,c = sorted(map(int,input().split()))
print((b-a) + c-b)

Solution (Python):
A,B,C = sorted(map(int,input().split()))
print(abs(A-B)+abs(B-C))

Solution (Python):
*a,=map(int,input().split())
print(max(a)-min(a))

Solution (Python):
A1,A2,A3 = sorted(list(map(int,input().split())))
print(A3-A1)

Solution (Python):
a,b,c=sorted(map(int,input().split()))
print(c-a)

Solution (Python):
an = list(map(int, input().split()))
print(max(an) - min(an))

Solution (Python):
A = list(map(int, input().split()))
print(max(A) - min(A))

Solution (Python):
a1,a2,a3=map(int,input().split())
print(abs(a1-a2)+abs(a2-a3)+abs(a3-a1)-max(abs(a1-a2),abs(a2-a3),abs(a3-a1)))

Solution (Python):
def task_schedule(tasks):
    out = 0
    tasks = sorted(tasks)
    idx = tasks[0]
    for i in tasks[1:]:
        out += abs(i - idx)
        idx = i
    return out

tasks = list((int(x) for x in raw_input().split()))
print task_schedule(tasks)

Solution (Python):
a = list(map(int, input().split()))

a01 = abs(a[0] - a[1])
a02 = abs(a[0] - a[2])
a12 = abs(a[1] - a[2])

cost = sorted([a01, a02, a12])

print(cost[0] + cost[1])

Solution (Python):

A = list(map(int, input().split()))



print(max(A) - min(A))

Solution (Python):
Ai = list(map(int, input().split()))

a_list = []
a_list.append(abs(Ai[0] - Ai[1]) + abs(Ai[1] - Ai[2]))
a_list.append(abs(Ai[0] - Ai[2]) + abs(Ai[2] - Ai[1]))
a_list.append(abs(Ai[1] - Ai[0]) + abs(Ai[0] - Ai[2]))
a_list.append(abs(Ai[1] - Ai[2]) + abs(Ai[2] - Ai[0]))
a_list.append(abs(Ai[2] - Ai[1]) + abs(Ai[1] - Ai[0]))
a_list.append(abs(Ai[2] - Ai[0]) + abs(Ai[0] - Ai[1]))

print(min(a_list))

Solution (Python):
a=list(map(int,input().split()))
a.sort()
print(a[2]-a[0])

Solution (Python):
A,B,C=map(int,input().split())
print(max(A,B,C)-min(A,B,C))

Solution (Python):
l=list(map(int,input().split()));print(max(l)-min(l))

Solution (Python):
A1,A2,A3 = sorted(list(map(int,input().split())))
print(A3-A1)

Solution (Python):
a, b, c = sorted(map(int, input().split()))

print(c - a)

Solution (Python):
A = sorted([int(x) for x in input().split()])
a=0
for i in range(len(A)-1):
  a+=abs(A[i+1]-A[i])
print(a)

Solution (Python):
*a,=map(int,input().split())
print(max(a)-min(a))

Solution (Python):
s = list(map(int,input().split()))
s.sort()
ans=0
for i in range(len(s)-1):
    ans+=s[i+1]-s[i]
print(ans)

Solution (Python):
import math
import sys
import queue
from collections import Counter
from itertools import accumulate
from fractions import gcd
from functools import reduce

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

mod = 1000000007

"""


    = sys.stdin.readline().rstrip()
    = list(sys.stdin.readline().rstrip())


    = int(sys.stdin.readline())
    = map(int, sys.stdin.readline().split())
    = list(map(int, sys.stdin.readline().split()))
    = [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

if __name__ == "__main__":
    L = list(map(int, sys.stdin.readline().split()))
    L.sort()
    print((L[2] - L[1]) + (L[1] - L[0]))

Solution (Python):

a = list(map(int, input().split()))
a = sorted(a)

print((a[1] - a[0]) + (a[2] - a[1]))

Solution (Python):
A1, A2, A3 = map(int, input().split())
a = abs(A2-A3)
b = abs(A3-A1)
c = abs(A1-A2)
print(a+b+c-max(a,b,c))

Solution (Python):
a, b, c = sorted(list(map(int, input().split())))
print((b - a) + (c - b))

Solution (Python):
N = list(map(int, input().split()))
N.sort()
print(sum([N[i+1] - N[i] for i in range(len(N)-1)]))

Solution (Python):
def main():
    A1, A2, A3 = map(int, input().split())
    cand = [abs(A1-A2) + abs(A2-A3), abs(A1-A3)+abs(A3-A2), abs(A2-A1)+abs(A1-A3)]
    return min(cand)

if __name__ == '__main__':
    print(main())

Solution (Python):
a=sorted(map(int,input().split()))
print(a[-1]-a[0])

Solution (Python):
a,b,c = sorted(map(int, input().split()))
print(c-a)

Solution (Python):
lst = sorted(map(int, input().split()))
print(lst[2]-lst[0])

Solution (Python):
a,b,c=map(int,input().split())
cost=[a,b,c]
cost.sort()

ans=[]
for i in range(2):
  ans.append(abs(cost[i+1]-cost[i]))
  
print(ans[0]+ans[1])

Solution (Python):
a,b,c=map(int,input().split())
print(max(a,b,c)-min(a,b,c))

Solution (Python):
a = list(map(int, input().split()))
print(min(abs(a[2] - a[1]) + abs(a[1] - a[0]),
          abs(a[1] - a[0]) + abs(a[0] - a[2]),
          abs(a[0] - a[2]) + abs(a[2] - a[1])))

Solution (Python):
import itertools
import sys


if __name__ == '__main__':
    a = list(map(int,input().split()))
    a = sorted(a)

    answer = sys.maxsize
    for e in list(itertools.permutations(a)):
        a1, a2, a3 = e
        answer = min(answer, abs(a2-a1) + abs(a3-a2))
    print(answer)

Solution (Python):
a=sorted(list(map(int,input().split())))
print(a[-1]-a[0])

Solution (Python):
a, b, c = map(int, input().split())

print(int(max([a, b, c]) - min([a, b, c])))

Solution (Python):
a,b,c = sorted(map(int,input().split()))
print(c - b + b - a)

Solution (Python):
a = sorted(list(map(int, input().split())))

ans = [0]
for i in range(len(a)-1):
    ans.append(abs(a[i]-a[i+1]))

print(sum(ans))

Solution (Python):
*a, = map(int,input().split())
print(max(a)-min(a))

Solution (Python):
a = sorted(input().split())
s = 0
for i in range(1,len(a)):
    s += abs(int(a[i]) - int(a[i-1]))

print(s)

Solution (Python):
a = list(map(int,input().split()))
print(max(a) - min(a))

Solution (Python):
a = sorted(list(map(int,input().split())))
print(a[2] - a[0])

Solution (Python):
A = list(map(int,input().split()))
A.sort()
print(abs(A[1]-A[0])+abs(A[2]-A[1]))

Solution (Python):
a = [int(i) for i in input().split()]
a12 = abs(a[0] - a[1])
a23 = abs(a[1] - a[2])
a31 = abs(a[2] - a[0])
print(min(a12+a23,a12+a31,a23+a31))

Solution (Python):
s = sorted(list(map(int, input().split())))

print(s[2]-s[0])

Solution (Python):
A = sorted(list(map(int, input().split())))
print((A[2] - A[1]) + (A[1] - A[0]))

Solution (Python):
A = list(map(int,input().split()))
A.sort()
ans = abs(A[1]-A[0]) + abs(A[2]-A[1])
print(ans)

Solution (Python):


A = list(map(int, input().split()))

ans = 10 ** 5
for i in range(3):
    for j in range(3):
        if i != j:
            k = 3 - i - j
            cost = abs(A[i] - A[j]) + abs(A[j] - A[k])
            ans = min(cost, ans)

print(ans)

Solution (Python):
a=list(map(int,input().split()))
print(max(a)-min(a))

Solution (Python):
a,b,c=map(int,input().split())
print(max(a,b,c)-min(a,b,c))

Solution (Python):
a,b,c=map(int,input().split())
print(max(a,b,c)-min(a,b,c))

Solution (Python):
a = list(map(int, input().split()))
print(max(a) - min(a))

Solution (Python):
s=list(map(int,input().split()))
s.sort()
ans=0
for i in range(1,len(s)):
    ans+=abs(s[i]-s[i-1])
print(ans)

Solution (Python):
a, b, c = map(int, input().split())
x = abs(a - b)
y = abs(b - c)
z = abs(c - a)
print(sum(sorted([x, y, z])[:2]))

Solution (Python):
A = list(map(int, input().split()))
A = sorted(A)
print((A[1] - A[0]) + (A[2] - A[1]))

Solution (Python):
a,b,c = sorted(map(int,input().split()))
print(c-a)

Solution (Python):
A=list(map(int,input().split()))
print(max(A)-min(A))

Solution (Python):
a = list(map(int, input().split()))
print(max(a) - min(a))

Solution (Python):
def solve():
    abc = sorted(list(map(int, input().split())))
    return abc[2] - abc[0]


if __name__ == "__main__":
    print(solve())

Solution (Python):
A = sorted([int(x) for x in input().split()])
print(A[2]-A[0])

Solution (Python):
import sys
from fractions import gcd
import bisect
 
stdin = sys.stdin
 
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
s = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

num = na()
num.sort()

print(num[2] - num[0])

Solution (Python):
a=list(map(int,input().split()))
print(max(a)-min(a))

Solution (Python):
a,b,c=map(int,input().split())
print(max(a,b,c)-min(a,b,c))

Solution (Python):
*a ,= map(int, input().split())

print(max(a)-min(a))

Solution (Python):
a = list(map(int, input().split()))
print(max(a)-min(a))

Solution (Python):
a = list(map(int,input().split()))
a.sort()
print(abs(a[0]-a[1])+abs(a[1]-a[2]))

Solution (Python):
As = sorted(list(map(int, input().split())), reverse=True)

cost = 0
for a, b in zip(As[:-1], As[1:]):
  cost += abs(a-b)

print(cost)

Solution (Python):
a, b, c = map(int, input().split())

d = abs(a-b)
e = abs(a-c)
f = abs(b-c)
g = [d,e,f]
h = sorted(g)
print(h[0]+h[1])

Solution (Python):
*a,=map(int,input().split())
print(max(a)-min(a))

Solution (Python):

A=list(map(int, input().split()))
A.sort()
print(A[2]-A[1]+A[1]-A[0])

Solution (Python):
a = list(map(int, input().split()))
a.sort()

print(a[2] - a[0])

Solution (Python):
def main():
    A = list(map(int, input().split()))

    sort_A = sorted(A)
    print(sort_A[2] - sort_A[0])

main()

Solution (Python):
a=sorted(map(int,input().split()))
print((a[1]-a[0])+(a[2]-a[1]))

Solution (Python):
t = list(map(int,input().split()))
print(max(t)-min(t))

Solution (Python):
a,b,c=map(int,input().split())
x=abs(a-b)
y=abs(b-c)
z=abs(a-c)
print(min(x+y,y+z,z+x))

Solution (Python):
*a,=map(int,input().split())
print(max(a)-min(a))

Solution (Python):
a = list(map(int,input().split()))
print(max(a) - min(a))

Solution (Python):
a,b,c=sorted(map(int,input().split()))
print(c-a)

Solution (Python):
a,b,c = map(int,input().split())
print(max(a,b,c)-min(a,b,c))

Solution (Python):
*a, = map(int, input().split())
print(max(a)- min(a))

Solution (Python):
a, b, c = sorted(map(int, input().split(" ")))
print(c - a)

Solution (Python):
a = list(map(int, input().split()))
a.sort()
c = 0
for i in range(1, len(a)):
    c += abs(a[i] - a[i-1])
print(c)

Solution (Python):
A = sorted([int(element) for element in input().split()])
print(A[2] - A[0])

Solution (Python):
a = list(map(int, input().split()))
print(max(a) - min(a))

Solution (Python):
a,b,c = sorted(map(int,input().split()))
print((c-b)+(b-a))

Solution (Python):
list = [int(a) for a in input().split()]
list.sort()
print ((list[2] - list[1]) + (list[1] - list[0]))

Solution (Python):
import os, sys, re, math

lines = sys.stdin.readlines()

a = [int(n) for n in lines[0].split()]

costs = []
s = sum(a)
for i in range(3):
    for j in range(3):
        if i != j:
            costs.append(abs(a[j] - a[i]) + abs((s - a[i] - a[j]) - a[j]))
print (min(costs))

Solution (Python):
line = raw_input()
a = [int(s) for s in line.split(' ')]
a = sorted(a)
prev = a[0]
ret = 0
for i in a:
    ret += i - prev
    prev = i
print ret

Solution (Python):
nums = sorted(list(map(int, input().split(' '))))
print(sum([abs(nums[i+1] - nums[i]) for i in range(len(nums) - 1)]))

Solution (Python):
abc = list(sorted(map(int, input().split())))
print(abc[2] - abc[0])

Solution (Python):
def test():
    a = list(map(int,input().split()))
    b = 0
    c = max(a)
    a.remove(max(a))
    for i in range(2):
        c = abs(c-max(a))
        b += c
        c = max(a)
        a.remove(max(a))
    print(b)


if __name__ == "__main__":
    test()

Solution (Python):
a,b,c=sorted(map(int,input().split()));print(c-a)

Solution (Python):
*a,=map(int,input().split())
print(max(a)-min(a))

Solution (Python):
a,b,c=map(int,input().split())
print(max(a,b,c)-min(a,b,c))

Solution (Python):
A1,A2,A3=map(int,input().split())

print(abs(A1-A2)+abs(A2-A3)+abs(A3-A1)-max(abs(A1-A2),abs(A2-A3),abs(A3-A1)))

Solution (Python):
A1,A2,A3=map(int,input().split())

if abs(A1-A2)==abs(A2-A3):
    print(abs(A1-A2)+abs(A2-A3)+abs(A3-A1)-abs(A1-A2))
elif abs(A2-A3)==abs(A3-A1):
    print(abs(A1-A2)+abs(A2-A3)+abs(A3-A1)-abs(A2-A3))
elif abs(A3-A1)==abs(A1-A2):
    print(abs(A1-A2)+abs(A2-A3)+abs(A3-A1)-abs(A3-A1))
else :
    print(abs(A1-A2)+abs(A2-A3)+abs(A3-A1)-max(abs(A1-A2),abs(A2-A3),abs(A3-A1)))

Solution (Python):
a,b,c=map(int,input().split())
l=[]
l.append(abs(a-b))
l.append(abs(b-c))
l.append(abs(c-a))
print(sum(l)-max(l))

Solution (Python):
a1, a2, a3 = map(int,input().split())
print(max(a1,a2,a3) - min(a1,a2,a3))

Solution (Python):
import math





inputa = input().split()


inputa = [int(n) for n in inputa]
inputa.sort()

a = int(inputa[0])
b = int(inputa[1])
c = int(inputa[2])




ans = abs(b - a) + abs(c - b)
print(ans)

Solution (Python):
*a,=map(int,input().split())
print(max(a)-min(a))

Solution (Python):
s=[int(i) for i in input().split()]
s_s=sorted(s)
print(s_s[2]-s_s[0])

Solution (Python):
a = list(map(int, input().split()))
sorted_a = sorted(a)
cost = 0
cost += sorted_a[1] - sorted_a[0] 
cost += sorted_a[2] - sorted_a[1] 
print(cost)

Solution (Python):
a, b, c =sorted(map(int, input().split()), reverse=True)
print((a-b)+(b-c))

Solution (Python):
s=[int(x) for x in input().split()]
print(min(abs(s[0]-s[1])+abs(s[1]-s[2]),
         abs(s[0]-s[2])+abs(s[2]-s[1]),
         abs(s[1]-s[0])+abs(s[0]-s[2]),
         abs(s[1]-s[2])+abs(s[2]-s[0]),
         abs(s[2]-s[0])+abs(s[0]-s[1]),
         abs(s[2]-s[1])+abs(s[1]-s[0]),
         )
     )

Solution (Python):
*a, = map(int, input().split())
print(max(a)-min(a))

Solution (Python):
A = list(map(int, input().split()))
A.sort()
print( A[2]-A[0] )

Solution (Python):
a,b,c=sorted(map(int,input().split()))

print(b-a+c-b)

Solution (Python):
*a,=map(int,input().split())
print(max(a)-min(a))

Solution (Python):
a=list(map(int,input().split()))
print(max(a)-min(a))

Solution (Python):
a = list(map(int, input().split()))
a.sort()
print(a[2]-a[0])

Solution (Python):
a, b, c = sorted(map(int, input().split()))
print(c-a)

Solution (Python):
a,b,c=sorted(map(int, input().split()))
num=abs(b-c)+abs(a-b)
print(num)

Solution (Python):
arr=sorted(map(int,input().split()))
print(arr[-1]-arr[0])

Solution (Python):
arr=sorted(map(int,input().split()))
print(sum([b-a for a,b in zip(arr, arr[1:])]))

Solution (Python):

a = sorted(list(map(int, input().split())))

print(a[-1] - a[0])

Solution (Python):
A = list(map(int,input().split()))
A.sort()
print(abs(A[1]-A[0]) + abs(A[2]-A[1]))

Solution (Python):

a = list(map(int, input().split()))
a.sort()
print((a[1]-a[0])+(a[2]-a[1]))

Solution (Python):
a,b,c=sorted(map(int,input().split()))
print(c-a)

Solution (Python):
A = sorted(map(int,input().split()))

print(abs(A[1]-A[0])+abs(A[2]-A[1]))

Solution (Python):
l= list(map(int, input().split()))
l.sort()
print(l[2] - l[0])