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):
a,b,c=map(int,input().split())
d=[a,b,c]
d.sort()

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

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

print(ans)

Solution (Python):
A = [int(i) for i in 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):
num = list(map(int,input().split()))
list = sorted(num)
a=0
a=a+abs(list[1]-list[0])
a=a+abs(list[2]-list[1])
print(a)

Solution (Python):

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

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()

d1 = a[0]-a[1];d2 = a[1]-a[2]

if d1 < 0:
    d1 = -d1
if d2 < 0:
    d2 = -d2
    
print(d1+d2)

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

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

Solution (Python):


import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

a = na()
ans = inf
for i in range(3):
    b = i
    c = inf
    for j in range(3):
        if j != i:
            d = abs(a[i] - a[j])
            if c > d:
                c = d
                b = j
    ans = min(ans, c + abs(a[((i + 1) ^ (b + 1)) - 1] - a[b]))

print(ans)

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

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

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 = 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,b,c = sorted(map(int,input().split()))
print(c - a)

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

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

Solution (Python):
import itertools
A=list(map(int,input().split()))
ans=6373532642
for l in itertools.permutations(A):
  ans=min(ans,abs(l[0]-l[1])+abs(l[1]-l[2]))
print(ans)

Solution (Python):

a1,a2,a3=list(map(int,input().split()))
b=[]
b.append(abs(a1-a2))
b.append(abs(a2-a3))
b.append(abs(a1-a3))
m=max(b)
b.remove(m)
print(sum(b))

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

a.sort()

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

print(ans)

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

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

a = lists[1] - lists[0]
b = lists[2] - lists[1]
print(a + b)

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

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):
a = list(map(int,input().split()))
dif = sorted([abs(a[0]-a[1]),abs(a[1]-a[2]),abs(a[0]-a[2])])
print(dif[0]+dif[1])

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

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

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

print(ans)

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

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

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

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

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

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

for i in range(2):
  ans += A[i] - A[i+1]

print(ans)

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

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

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):
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    *a, = map(int, sys.stdin.readline().split())
    print(max(a) - min(a))


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    a = sorted(list(map(int, sys.stdin.readline().split())))
    print(a[1]-a[0]+a[2]-a[1])


if __name__ == '__main__':
    main()

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

Solution (Python):

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

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

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

Solution (Python):
a,b,c = map(int,input().split())
anser_list = []
anser_list.append(abs(b-a) + abs(c-b))
anser_list.append(abs(c-a) + abs(b-c))
anser_list.append(abs(a-b) + abs(c-a))
anser_list.append(abs(c-b) + abs(a-c))
anser_list.append(abs(a-c) + abs(b-a))
anser_list.append(abs(b-c) + abs(a-b))

print(min(anser_list))

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

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

ans = []

ans.append(abs(x-y))
ans.append(abs(y-z))
ans.append(abs(x-z))

ans.sort()
ans.pop(-1)

print(sum(ans))

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

print(sorted(l)[1]-sorted(l)[0] + sorted(l)[2]-sorted(l)[1])

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

Solution (Python):
a = [int(x) for x in input().split()]

a.sort()

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

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

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):
from itertools import permutations
from functools import reduce
l=list(map(int,input().split()))
permutations_list=list(permutations(l))
ans=900
for i in permutations_list:
  ss=0
  for j in range(1,len(i)):
    ss+=abs(i[j]-i[j-1])
  ans=min(ans,ss)
print(ans)

Solution (Python):
A_list = [int(i) for i in input().split()]
A_list.sort()

ans = 0
for i in range(len(A_list)-1):
  ans += (A_list[i+1] - A_list[i])

print(ans)

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):
a = list(map(int, input().split()))
a.sort()

s = [0]*3
for i in range(1, 3):
    s[i] = a[i] - a[i-1]
    
print(sum(s))

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()))
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=sorted(list(map(int,input().split())))
print(A[2]-A[0])

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

Solution (Python):



A_list = list(map(int, input().rstrip().split()))


A_list.sort()

min_cost=A_list[-1]*A_list[-1]
for i,i_v in enumerate(A_list):
    A_list_i = A_list[:]
    del A_list_i[i]
    for j,j_v in  enumerate(A_list_i):
        A_list_j = A_list_i[:]
        del A_list_j[j]
        for k,k_v in  enumerate(A_list_j):
            cost = abs(j_v - i_v) + abs(k_v - j_v)
            if cost < min_cost:
                min_cost = cost

print(min_cost)

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

Solution (Python):
S,M,L=sorted(map(int,input().split()))
print(L-S)

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

mn = min(A1, A2, A3)
mx = max(A1, A2, A3)
mi = A1 + A2 + A3 - mn -mx

result = abs(mn - mi) + abs(mi - mx)
print(result)

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

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

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):
l=list(map(int,input().split()))
l.sort()
print(abs(l[0]-l[1])+abs(l[1]-l[2]))

Solution (Python):
A = list(map(int, input().split()))
ans = 101
for i in range(3):
    now_sum = abs(A[0] - A[i]) + abs(A[1] - A[i]) + abs(A[2] - A[i])
    ans = min(ans, now_sum)
print(ans)

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())
print(max(A, B, C) - min(A, B, C))

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

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

Solution (Python):

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

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

Solution (Python):
a = list(map(int, input().split()))
s = sorted(a, reverse=True)
ans = [s[i]-s[i+1] for i in range(2)]
print(sum(ans))

Solution (Python):
a,b,c = map(int,input().split())
ab = abs(a-b)
bc = abs(b-c)
ac = abs(a-c)
x = max(ab,bc,ac)
print(ab+bc+ac-x)

Solution (Python):
A = list(map(int, input().split()))
A.sort(reverse=True)
sum = 0

for i in range(len(A) - 1):
	sum += A[i] - A[i+1]

print(sum)

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

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())
ans=max(a,b,c)-min(a,b,c)
print(ans)

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 = map(int, input().split())
l = []
sum = abs(a-b) + abs(b-c)
l.append(sum)
sum = abs(a-c) + abs(c-b)
l.append(sum)
sum = abs(b-a) + abs(a-c)
l.append(sum)
sum = abs(b-c) + abs(c-a)
l.append(sum)
sum = abs(c-b) + abs(b-a)
l.append(sum)
sum = abs(c-a) + abs(a-b)
print(min(l))

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

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

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

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=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 = list(map(int, input().split()))
lis = [abs(a[0]-a[1]),abs(a[1]-a[2]),abs(a[2]-a[0])]
lis.sort()
print(lis[0]+lis[1])

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

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[2]-a[0])

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()))
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 - b + b - a)

Solution (Python):
A = list(map(int, 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-b+b-a)

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

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

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

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

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


if __name__ == '__main__':
    main()

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

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

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

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

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

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

Solution (Python):

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

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

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

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

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

print(a)

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

print(max(A1,A2,A3) - min(A1,A2,A3))

Solution (Python):
A1, A2, A3 = list(map(int, input().split()))
h = [A1, A2, A3]
maxvalue = -1
minvalue = 101
for i in range(len(h)):
    if h[i] > maxvalue:
        maxvalue = h[i]
for i in range(len(h)):
    if h[i] < minvalue:
        minvalue = h[i]
print(maxvalue - minvalue)

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

print(abs(abs1+abs2))

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

Solution (Python):
tasks = [int(i) for i in input().split()]

taskes = sorted(tasks)

costs = 0

for i in range(2):
    costs += abs(taskes[i] - taskes[i+1])
print(costs)

Solution (Python):




def main():
    A1, A2, A3 = map(int, input().split())
    print(max(A1, A2, A3) - min(A1, A2, A3))


if __name__ == "__main__":
    main()

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

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

Solution (Python):
a1, a2, a3 = map(int, input().split())
list = [a1, a2, a3]
list.sort()
cost = 0
for id in range(3):
    if id == 0: continue
    cost += list[id] - list[id - 1]
print(cost)

Solution (Python):
import itertools
a=list(map(int,input().split()))
ans=999
l=[0,1,2]
for x in itertools.permutations(l,3):
  tmp=abs(a[x[0]]-a[x[1]])+abs(a[x[1]]-a[x[2]])
  if tmp <=ans:
    ans =tmp
print(ans)

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

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,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 = input().split(' ')
A = abs(int(a)-int(b))
B = abs(int(b)-int(c))
C = abs(int(c)-int(a))
N = A + B + C -max(A, B, C)
print(N)

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

a.sort()

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

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

Solution (Python):
inp = input().split()
data = []

for i in inp:
  data.append(int(i))

result = 0

for j in sorted(data, reverse=True):
  if j == max(data):
    pass
  else:
    result += abs(j - i)
  i = j
print(result)

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

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

print(ans)

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

a1 = a*0+abs(a-b)+abs(c-b)
a2 = a*0+abs(a-c)+abs(b-c)
b1 = b*0+abs(b-a)+abs(a-c)
b2 = b*0+abs(b-c)+abs(c-a)
c1 = c*0+abs(c-a)+abs(a-b)
c2 = c*0+abs(c-b)+abs(b-a)
ans = min(a1,a2,b1,b2,c1,c2)
print(ans)

Solution (Python):
A=list(map(int,input().split()))
A.sort()
res=0
for i in range(len(A)):
  if i==0:
    continue
  else:
    res=res+A[i]-A[i-1]
print(res)

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

Solution (Python):
a=[int(x) for x in input().split()]

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

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

Solution (Python):
A1,A2,A3=map(int,input().split())
l=[A1,A2,A3]
l.sort(reverse=True)

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

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

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

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

Solution (Python):
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

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

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

Solution (Python):

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
a = list(map(int,input().split()))
a.sort()
print(a[-1]-a[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[1]-a[0])+(a[2]-a[1]))

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

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

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

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

Solution (Python):
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys



read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

A = [int(x) for x in readline().split()]
print(max(A) - min(A))

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

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

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

Solution (Python):
a,b,c=map(int,input().split())
AB=abs(a-b)
BC=abs(b-c)
AC=abs(c-a)
x=max(AB,BC,AC)
print(AB+BC+AC-x)

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

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

Solution (Python):
a,b,c=map(int,input().split())
print(min(abs(b-a)+abs(c-b),abs(c-a)+abs(b-c),abs(c-b)+abs(a-c),abs(a-b)+abs(c-a),abs(a-c)+abs(b-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 = 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 = 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):
A1, A2, A3 = map(int, input().split())

ans = max(A1, A2, A3) - min(A1, A2, A3)

print(ans)

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

Solution (Python):
A = list(map(int, input().split()))
A.sort()
n = []
for i in range(2):
    n.append(abs(A[1] - A[0]))
    A.remove(A[0])
print(sum(n))

Solution (Python):
from numpy import diff
print(sum(diff(sorted(list(map(int, input().split()))))))

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

Solution (Python):
def main():
    from sys import stdin, setrecursionlimit
    setrecursionlimit(10**6)
    r = stdin.readline()[:-1]
    
    
    

    a = list(map(int, r.split()))
    a.sort()
    res = 0
    for i in range(1,3):
        res += a[i] - a[i-1]
    print(res)

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
import math
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

def swap(a,b):
    return (b,a)

def my_round(a,dig=0):
    p = 10 ** dig
    return (a * p * 2 + 1) // 2 / p

def gcd(a,b): 
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

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

def divisors(a): 
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def is_prime(a): 
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): 
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

def prime_fact(a): 
    sqrt = math.sqrt(a)
    res = []
    i = 2
    if is_prime(a):
        res.append(a)
    else:
        while a!=1:
            while a%i==0:
                res.append(i)
                a //= i
            i += 1
    return res

def main():
    a = [x for x in map(int,input().split())]
    ans = 0
    x = []
    x.append(abs(a[0]-a[1]))
    x.append(abs(a[1]-a[2]))
    x.append(abs(a[0]-a[2]))
    x.sort()
    for i in range(2):
        ans += x[i]
    print(ans)
    return

if __name__=='__main__':
    main()

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

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

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

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

A = sorted(A)

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

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,b,c=sorted(map(int, input().split()))

print(c-a)

Solution (Python):
import itertools
a = list(map(int,input().split()))
lst_a =  list(itertools.permutations(a))
array = []
for i in lst_a:
    array.append(abs(i[0]-i[1]) + abs(i[1]-i[2]))
print(min(array))

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

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

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

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

li = [abs(a-b),abs(a-c),abs(b-c)]
print(sum(li)-max(li))

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

Solution (Python):
task = input().split()
t_i = [int(s) for s in task]
cost = 0

for i in range(2):
    for j in range(2):
        if(t_i[j] > t_i[j+1]):
            t_i[j], t_i[j+1] = t_i[j+1], t_i[j]
cost = t_i[1] - t_i[0] + t_i[2] - t_i[1]
print(cost)

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

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):
a, b, c=sorted(map(int, input().split()))
print((b-a)+(c-b))

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

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

ab = abs(a - b) 
ac = abs(a - c)
bc = abs(b - c)

l = [ab, ac, bc]

print(sum(l) - max(l))

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

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

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

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):
a, b, c = map(int, input().split())

p = max(a, b, c)
q = min(a, b, c)
r = a + b + c - p - q

print(0 + r - q + p - r)

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

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

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

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

x = abs(A1 - A2)
y = abs(A2 - A3)
z = abs(A3 - A1)

ans = sum([x, y, z]) - max(x, y, z)
print(ans)

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

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

print(ans)

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

result = 0

for i in range(1,len(tSorted)):
  result += abs(tSorted[i-1]-tSorted[i])

print(result)

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

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline
li = [int(i) for i in input().split()]
sum =0
li.sort()
for i in range(1,3) :
    sum += abs(li[i] - li[i-1])
print(sum)

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

Solution (Python):
import numpy as np
A = list(map(int, input().split()))

A = np.array(A)
A.sort()

print(np.diff(A).sum())

Solution (Python):
a,b,c=map(int,input().split())
d=abs(a-b)
e=abs(b-c)
f=abs(c-a)
s1=d+e
s2=e+f
s3=f+d
l=[s1,s2,s3]
l.sort()
print(l[0])

Solution (Python):

lst = list(map(int, input().split()))
sor = sorted(lst)
cost = 0
for i in range(len(sor)):
    if i == 0:
        continue
    else:
        cost += abs(sor[i]-sor[i-1])
print(cost)

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):
A1,A2,A3=map(int, input().split())  

print(max(A1,A2,A3)-min(A1,A2,A3))

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

Solution (Python):
a, b, c = map(lambda x: int(x), input().split())
lis = [a, b, c]
lis.sort()
a, b, c = lis[2],lis[1],lis[0]

if abs(a - b) < abs(c - a):
  print(abs(a - b) + abs(b - c))
else:
  print(abs(a - c) + abs(b - c))

Solution (Python):
def main():
    a1,a2,a3 = map(int, input().split())

    diff = [abs(a1-a2),abs(a1-a3),abs(a2-a3)]
    maximum = max(diff)
    print(sum(diff) - maximum)


if __name__ == '__main__':
    main()

Solution (Python):
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


A = list(map(int, sys.stdin.buffer.readline().split()))
A = np.array(A, dtype=int)

ans = A.max() - A.min()
print(ans)

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

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()
ans = abs(a[1]-a[0]) + abs(a[2] - a[1])
print(ans)

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):
*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):
x,y,z = sorted(map(int,input().split()))
print(-x+z)

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

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

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

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=map(int,input().split())
l=sorted([abs(c-a),abs(c-b),abs(b-a)])
print(l[0]+l[1])

Solution (Python):
import sys

*a, = map(int, sys.stdin.readline().split())

def main():
    return max(a) - min(a)

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

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

print(x+y+z-max(x,y,z))

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

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