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

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

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

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

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

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

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

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

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

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

print(ans)

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

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

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

lst.sort(reverse=True)
print(abs(lst[0] - lst[1]) + abs(lst[1] - lst[2]))

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

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

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

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

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 = [int(x) for x in input().split()]

def cost(A, i, j, k):
    return abs(A[i] - A[j])+ abs(A[j] - A[k])

print(min(
    cost(A, 0, 1, 2),
    cost(A, 0, 2, 1),
    cost(A, 1, 0, 2),
    cost(A, 1, 2, 0),
    cost(A, 2, 1, 0),
    cost(A, 2, 0, 1)
))

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

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

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

Solution (Python):

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

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

Solution (Python):
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    a = LIST()
    min_cost = INF

    for i in range(3):
        for j in range(3):
            for k in range(3):
                if not i == j and not j == k and not k == i:
                    cost = abs(a[j]-a[i]) + abs(a[k]-a[j])
                    if cost < min_cost:
                        min_cost = cost

    print(min_cost)


if __name__ == '__main__':
    main()

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

A.sort()

S = (A[2]-A[1]) + (A[1]-A[0])

print(S)

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

a.sort()

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

print(cost)

Solution (Python):


A1, A2, A3 = map(int, input().rstrip().split())

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

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

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

def main():
    l = list(map(int, input().split()))
    l = sorted(l)

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


if __name__ == '__main__' :
    main()

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

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


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

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

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

Solution (Python):
A = input().split()
B = []
C = 0
for k in range(3):
  B.append(int(A[k]))
B.sort()
for i in range(2):
  C += int(B[i + 1]) - int(B[i])
print(C)

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

Solution (Python):
a1, a2, a3 = [int(x) for x in input().split()]
a1a2 = abs(a1 - a2)
a1a3 = abs(a1 - a3)
a2a3 = abs(a2 - a3)

print(sum(sorted([a1a2, a1a3, a2a3])[:2]))

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

Solution (Python):



if __name__ == '__main__':
    *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):
A1, A2, A3 = list(map(int,input().split()))
if A1 == A2 and A2 == A3:
    print(0)
else:
    print(max(A1,A2,A3)-min(A1,A2,A3))

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

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

Solution (Python):
Tmp = []
Tmp = input().rstrip().split(' ')
 
Ans = []
 
for i in range(3):
  nTmp = int(Tmp[i])
  
  Ans.append(nTmp)
 
Ans.sort()
 
nAns = (Ans[1]-Ans[0])
nAns += Ans[2]-Ans[1]

print(nAns)

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

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

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

Solution (Python):
a1,a2,a3 = map(int,input().split())
task1 = abs(a2-a1)
task2 = abs(a3-a2)
task3 = abs(a1-a3)
maxtask = max([task1,task2,task3])
print(task1+task2+task3-maxtask)

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

Solution (Python):
l = [int(i) for i in input().split()]
m = []
for i in range(3):
    m.append(abs(l[i-1]-l[i]))
print(sum(m) - max(m))

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

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

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

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

Solution (Python):
a=list(map(int,input().split()))
a2=sorted(a)
print(a2[2]-a2[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()))
if a[0] == a[1] and a[1] == a[2]:
    print(0)
else:
    print(max(a[0],a[1],a[2]) - min(a[0],a[1],a[2]))

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

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

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

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

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

sorted_list = sorted(a_list, reverse=True)
x_list = []

for i, a1 in enumerate(sorted_list[:-1]):
    a2 = sorted_list[i+1]
    x = abs(a1-a2)
    x_list.append(x)

ans = sum(x_list)
print(ans)

Solution (Python):

import itertools

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

res = sum(xs)
for ys in itertools.permutations(xs):
    tmp = abs(ys[1] - ys[0]) + abs(ys[2] - ys[1])
    res = min(res, tmp)

print(res)

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(reverse=True)
print(A[0]-A[2])

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

li = [abs(a-b), abs(a-c), abs(b-c)]
li.sort()
print(li[0] + li[1])

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

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

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

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

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()
ans = 0
for i in range(2):
    ans += abs(A[i + 1] - A[i])


print(ans)

Solution (Python):
A = sorted(list(map(int,input().split())))
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()))

cost = []
cost.append(abs(A[0] - A[1]))
cost.append(abs(A[1] - A[2]))
cost.append(abs(A[2] - A[0]))
cost.remove(max(cost))

print(sum(cost))

Solution (Python):
from functools import reduce
import math

def main():
    
    
    
    

    
    
    
    
    
    

    
    

    
    
    
    
    
    
    
    
    
    INF = float("inf")

    
    MOD = 10**9+7
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    a = list(int(_) for _ in input().split())
    a.sort()
    
    print(abs(a[0]-a[1]) + abs(a[1]-a[2]))
    
if __name__ == '__main__':
    main()

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

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

Solution (Python):
A1,A2,A3 = map(int,input().split())
A12 = abs(A1-A2)
A23 = abs(A2-A3)
A31 = abs(A3-A1)

print(A12+A23+A31-max(A12,A23,A31))

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()))
l.sort()
ans = []
for i in range(len(l)-1):
  ans.append(l[i+1] - l[i])
print(sum(ans))

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

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

A.sort()

ans = 0
pre = A[0]
for a in A:
    ans += a - pre
    pre = a

print(ans)

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

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

Solution (Python):



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

A.sort()






print((0) + (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])

Solution (Python):

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))



sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A = LIST()
per = list(permutations(A))
ans_l = []
for p in per:
    ans = 0
    for i in range(len(p)-1):
        ans += abs(p[i+1] - p[i])
    ans_l.append(ans)
print(min(ans_l))

Solution (Python):


a,b,c = [int(i) for i in input().split()]

A = [a,b,c]
A.sort()




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

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

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

print(max([x,y,z])-min([x,y,z]))

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

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

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    a, b, c = LI()
    ans = 10 ** 5
    ans = min(ans, abs(a - b) + abs(b - c))
    ans = min(ans, abs(a - c) + abs(b - c))
    ans = min(ans, abs(a - c) + abs(a - b))
    
    print(ans)
    

    return


def B():
    return


def C():
    return


def D():
    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == '__main__':
    A()

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

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

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

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

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

Solution (Python):
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    al = list(map(int, input().split()))

    print(max(al) - min(al))

Solution (Python):
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    al = list(map(int, input().split()))

    al.sort()

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

Solution (Python):
A = list(map(int, input().split(" ")))
ans = min((abs(A[0]-A[1]) + abs(A[1]-A[2]), abs(A[0]-A[2]) + abs(A[1]-A[2]), abs(A[0]-A[1]) + abs(A[0]-A[2])))
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):
a1, a2, a3 = map(int, input().split())

print(abs(a1-a2)+abs(a2-a3)+abs(a3-a1)-(max(a1,a2,a3)-min(a1, a2, a3)))

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

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

Solution (Python):



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

Solution (Python):

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

print(max(l) - min(l))

Solution (Python):
a1, a2, a3 = map(int, input().split())
ans = sum([abs(a1-a2), abs(a3-a2), abs(a1-a3)])
ans -= max([abs(a1-a2), abs(a3-a2), abs(a1-a3)])
print(ans)

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

A.sort()

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

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

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

Solution (Python):
tasks = sorted([int(v) for v in input().split()])
print(tasks[-1]-tasks[0])

Solution (Python):

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



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

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

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

x2=sorted(x)

res=x2[2]-x2[0]

print(res)

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

count = 0

for i in range(len(temp_list)):
  if i == 0:
    continue
  count += abs(temp_list[i-1] - temp_list[i])
  
print(count)

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

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

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

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

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

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

Solution (Python):
def main():
    A = list(map(int, input().split()))
    B = sorted(A, reverse=True)
    retval = 0
    for i in range(1, len(B)):
        retval += B[i-1] - B[i]
    print(retval)


if __name__ == "__main__":
    main()

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

Solution (Python):

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

Solution (Python):
As = input().split()
result =  int(max(As)) - int(min(As))
print(-result if result<0 else result)

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

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

Solution (Python):
A, B, C = map(int, input().split())
X = abs(A-B)
Y = abs(B-C)
Z = abs(C-A)
lists = [X, Y, Z]
W = max(lists)
print(X + Y + Z - W)

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

Solution (Python):
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

A1, A2, A3 = nl()

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

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

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

Solution (Python):
from itertools import permutations

a = list(map(int,input().split()))
permutation = list(permutations([0,1,2]))

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

print(min(ans))

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

Solution (Python):

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

lis.sort()

ans = 0

for i in range( len(lis) - 1 ):

    ans += lis[i + 1] - lis[i]

print (ans)

Solution (Python):
a1, a2, a3 = map(int, input().split())
dist = [abs(a1 - a2), abs(a2 - a3), abs(a1 - a3)]
dist.sort()
print(sum(dist[0:2]))

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

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

Solution (Python):
c = list(map(int,input().split()))
x = max(c)
c.remove(x)
y = max(c)
c.remove(y)
z = max(c)
c.remove(z)

print(x - z)

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

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

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

Solution (Python):
line = input()
words = line.split()

num_list = []
for elm in words:
    num_list.append(int(elm))

num_list.sort()
score = 0
for i, num in enumerate(num_list):
    if i < (len(num_list) - 1):
        score += (abs(num_list[i] - num_list[i+1]))
    else:
        break

print(score)

Solution (Python):
import numpy as np
a_list = list(map(int, input().split()))
sorted_list = sorted(a_list)
sorted_list[2] = sorted_list[2] - sorted_list[1]
sorted_list[1] = sorted_list[1] - sorted_list[0]
sorted_list[0] = 0
print(np.sum(sorted_list))

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

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

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

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

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

Solution (Python):
a_s = [int(v) for v in input().split()]
a_s.sort()
c_s = [a_s[i] - a_s[i - 1] for i in range(1, 3)]
print(sum(c_s))

Solution (Python):

import sys


def solve(A: "List[int]"):
    print(max(A) - min(A))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = [ int(next(tokens)) for _ in range(3) ]  
    solve(A)

if __name__ == '__main__':
    main()

Solution (Python):
a = input().split()
a = [int(a[i]) for i in range(3)]
a.sort()
s = 0
for i in range(len(a)):
  if i > 0:
    s = s + a[i] - a[i-1]
print(s)

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

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

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

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

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):
import heapq

a = list(map(lambda x: int(x), input().split()))


a_heap = []
for a_item in a:
  heapq.heappush(a_heap, a_item)

prev = heapq.heappop(a_heap)

answer = 0
while(len(a_heap) > 0):
  next = heapq.heappop(a_heap)
  answer = answer + (next - prev)
  prev = next

print(answer)

Solution (Python):



import sys

input = sys.stdin.readline

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

main()

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

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

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

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

Solution (Python):
def abc():
    a1, a2, a3 = map(int, input().rstrip().split())
    costs = list()
    costs.append(abs(a1 - a2))
    costs.append(abs(a1 - a3))
    costs.append(abs(a2 - a3))
    costs.sort()
    print(costs[0] + costs[1])


abc()

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

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

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 = list(map(int, input().split()))
print(max(A)-min(A))

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

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

print(cost)

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

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

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.sort()
print(A[1]-A[0]+A[2]-A[1])

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

reverse = True if abs(A[0] - A[1]) > abs(A[-2] - A[-1]) else False
prev = -1
sum = 0
for a in sorted(A, reverse=reverse):
    if prev == -1:
        prev = a
        continue
    sum += abs(prev - a)
    prev = a
print(sum)

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

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

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

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

Solution (Python):
import itertools
As = list(map(int,input().split()))
perms = list(itertools.permutations(As))
min_val = 300
for i in perms:
  vals = abs(i[1] - i[0]) + abs(i[2] - i[1])
  if min_val > vals:
    min_val = vals
print(min_val)

Solution (Python):
Aa, Ab, Ac = map(int, input().split())

li = []

li.append(Aa)
li.append(Ab)
li.append(Ac)

li.sort()

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

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

a.sort(reverse=True)

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

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

A.sort(reverse=True)

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

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

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

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np

def main():
	A, B, C = map(int, input().split(" "))
	
	tmp = []
	tmp.append(A)
	tmp.append(B)
	tmp.append(C)
	tmp.sort()
	
	a = abs(tmp[1] - tmp[0])
	b = abs(tmp[2] - tmp[1])
		
	print(a + b)
	
if __name__ == "__main__":
	main()

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

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

Solution (Python):
import sys
input = sys.stdin.readline

L = [int(v) for v in input().split()]

print(abs(max(L) - min(L)))

Solution (Python):
import math

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

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

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

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

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

Solution (Python):


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

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

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

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

A.sort(reverse = True)
print (A[0]-A[2])

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

print(max(list) -min(list))

Solution (Python):
a = 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(reverse=False)

ans = 0
ans = l[1]-l[0]
ans = ans + l[2]- l[1]

print(ans)

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

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

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

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

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

Solution (Python):
task = sorted([ int(v) for v in input().split() ])

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

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

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

task=sorted(task)

cost=0

for i in range(len(task)-1):
    x=abs(task[i]-task[i+1])
    cost=cost+x


print(cost)

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

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

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

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

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


A11 = abs(A2-A1) + abs(A3-A2)
A12 = abs(A3-A1) + abs(A2-A3)


A21 = abs(A1-A2) + abs(A3-A1)
A22 = abs(A3-A2) + abs(A1-A3)


A31 = abs(A1-A3) + abs(A2-A1)
A32 = abs(A2-A3) + abs(A1-A2)

print(min(A11,A12,A21,A22,A31,A32))

Solution (Python):

import sys
import itertools

def solve(A: "List[int]"):

    minc = float("inf")
    for al in itertools.permutations(A):
        c = 0
        for i in range(1,len(al)):
            c += abs(al[i]-al[i-1])
        minc = min(minc,c)
    print(minc)

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = [ int(next(tokens)) for _ in range(3) ]  
    solve(A)

if __name__ == '__main__':
    main()

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

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

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

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