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

Solution (Python):
A,B,C = map(int,input().split())
a = [A,B,C]
a.sort()

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):
def solve(string):
    a = sorted(map(int, string.split()))
    return str(sum([abs(a1 - a0) for a0, a1 in zip(a, a[1:])]))


if __name__ == '__main__':
    print(solve(input()))

Solution (Python):
from itertools import permutations


def solve(string):
    a = map(int, string.split())
    ans = min(sum([abs(_p0 - _p1) for _p0, _p1 in zip(p, p[1:])]) for p in permutations(a, 3))
    return str(ans)


if __name__ == '__main__':
    print(solve(input()))

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

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

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

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

total1=abs(a-b)+abs(b-c)
total2=abs(a-c)+abs(b-c)
total3=abs(a-b)+abs(a-c)

temp=0

if total1>total2:
	temp=total1
	total1=total2
	total2=temp

if total1>total3:
	temp=total1
	total1=total3
	total3=temp

print(total1)

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

Solution (Python):
from sys import stdin
A = [int(x) for x in stdin.readline().rstrip().split()]

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

Solution (Python):
def task_scheduling_problem(A1: int, A2: int, A3: int)->int:
    return max(A1, A2, A3) - min(A1, A2, A3)


if __name__ == "__main__":
    A1, A2, A3 = map(int, input().split())
    ans = task_scheduling_problem(A1, A2, A3)
    print(ans)

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

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

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

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

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

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

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

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

Solution (Python):
A1, A2, A3 = map(int, input().split())
costs = [abs(A1-A2), abs(A2-A3), abs(A3-A1)]
sorted_costs = sorted(costs)
print(sum(sorted_costs[:-1:]))

Solution (Python):


import sys 


a1,a2,a3 = map(int, sys.stdin.readline().rstrip().split())

def solve(i,j,k):
  ret = abs(i-j) + abs(j-k)
  return ret

s1 = solve(a1,a2,a3)
s2 = solve(a3,a1,a2)
s3 = solve(a2,a3,a1)
print(min(s1,s2,s3))

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

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

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

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

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

Solution (Python):
An = sorted(list(map(int,input().split())))
ans = 0
coslist = []
for i,a in enumerate(An):
    if i ==0:
        coslist.append(abs(a-i))
    else:
        ans+=abs(a-(An[i-1]))
        coslist.append(abs(a-(An[i-1])))
print(ans)

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

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

print(answer)

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

Solution (Python):
list1 = [int(a) for a in input().split()]
list1_0 = list1[0] 
list1_1 = list1[1] 
list1_2 = list1[2] 

list2 = [list1_0, list1_1, list1_2]
list2.sort()
b = max(list2) - list2[1]
c = list2[1] - min(list2)
print(b + c)

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

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

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

cost1 = abs(a1 - a2) + abs(a2 - a3)
cost2 = abs(a1 - a3) + abs(a3 - a2)
cost3 = abs(a3 - a1) + abs(a1 - a2)

print(min((cost1, cost2, cost3)))

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

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

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

l=[]
l.append(abs(a[0]-a[1])+abs(a[1]-a[2]))
l.append(abs(a[1]-a[2])+abs(a[2]-a[0]))
l.append(abs(a[2]-a[0])+abs(a[0]-a[1]))
print(min(l))

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

Solution (Python):
*cost_list,=map(int,input().split())
cost_list.sort(reverse=True)
sum=0
for i in range(len(cost_list)-1):
  sum+=(cost_list[i]-cost_list[i+1])
print(sum)

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

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

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

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

Solution (Python):

a1, a2, a3 = [int(x) for x in input().split()]
tl = sorted([a1, a2, a3])
print(tl[-1] - tl[0])

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

l = sorted(l, reverse=True)
print(sum(a-b for a, b in zip(l, l[1:])))

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

ans = max(As) - min(As)

print(ans)
print()

Solution (Python):
L=[int(i) for i in input().split()]
A=abs(L[0]-L[1])
B=abs(L[1]-L[2])
C=abs(L[2]-L[0])
S=[A+B,A+C,B+C]
print(min(S))

Solution (Python):
task=list(map(int,input().split(" ")))
task.sort()
cost=0

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

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()))
print(max(a) - min(a))

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

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()))
print(max(a)-min(a))

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

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

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

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

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

Cost = [abs(a1 - a2), abs(a2 - a3), abs(a1 - a3)]
Cost.sort()

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

Solution (Python):
A, B, C = map(int, input().split())
L = [A, B, C]
L.sort()
ans = 0
for i in range(2):
    ans += abs(L[i+1] - L[i])
print(ans)

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

Solution (Python):
from sys import stdin
a,b,c=sorted([int(x) for x in stdin.readline().rstrip().split()], reverse=True)
print(a-c)

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

cost = 0
cache = 0
for task in tasks:
    if cache != 0:    
        cost += abs(cache - task)
    cache = task
print(cost)

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


if __name__ == "__main__":
    main()

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

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

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

def main():
  input = sys.stdin.readline
  A = list(map(int, input().split()))
  A = sorted(A)
  ans = 0
  for i in range(len(A)-1):
    ans += A[i+1] - A[i]
  print(ans)


if __name__ == '__main__':
  main()

Solution (Python):
import numpy as np

def input_numbers():
    temp = list(map(int, input().split()))
    return temp

def GCD(a, b):
    if(a < b):
        temp = a
        a = b
        b = temp
    a = a % b
    if(a == 0):
        return b
    else:
        return GCD(a, b)

a = input_numbers()

m = 10000000000000000000

for i in range(3):
    for j in range(3):
        for k in range(3):
            if(i != j and j != k and k != i):
                cost = abs(a[i] - a[j]) + abs(a[j] - a[k])
                m = min(m, cost)

print(m)

Solution (Python):
def main() -> None:
    l = list(map(int, input().split()))
    ls = sorted(l, reverse=True)
    ans = 0
    for i in range(len(ls) - 1):
        ans = ans + abs(ls[i] - ls[i+1])

    print(ans)


if __name__ == '__main__':
    main()

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

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

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

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

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

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 = [int(i) for i in input().split()]
A.sort()
print(A[1]-A[0] + A[2] - A[1])

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

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

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

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

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

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

ans = sorted([abs(a-b),abs(b-c),abs(c-a)])

print(sum(ans[:2]))

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

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

array = [abs(a1-a2), abs(a2-a3), abs(a3-a1)]
array.sort()
print(array[0] + array[1])

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

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

cost = A[1] -A[0]
cost +=  A[2] - A[1]

print(cost)

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

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

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

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

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

Solution (Python):
*a,=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 += abs(a[i] - a[i-1])
print(ans)

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

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

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

Solution (Python):
a = input().split()
for i in range(3):
    a[i] = int(a[i])
a = sorted(a)
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):
a = [int(i) for i in input().split()]
print(max(a) - min(a))

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

Solution (Python):

import sys



def solve(lines):
    l = list(map(int, lines.pop(0).split(' ')))
    l.sort()
    print(l[2] - l[0])








lines = [x.strip() for x in sys.stdin.readlines()]




solve(lines)

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

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

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


main()

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

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

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

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

Solution (Python):
""" AtCoder """

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

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

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

Solution (Python):


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

    D1 = abs(A[1] - A[0])
    D2 = abs(A[2] - A[1])
    D3 = abs(A[0] - A[2])

    print(D1 + D2 + D3 - max(D1, D2, D3))


if __name__ == '__main__':
    main()

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

Solution (Python):

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

Solution (Python):
X=input().split()
Y=(min(X))
X.remove(Y)
Z=int(min(X))
print(abs(Z-int(Y))+abs(int(max(X))-Z))

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

print(cost)

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

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(len(A)-1):
    ans += abs(A[i+1] - A[i])
print(ans)

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

main()

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

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

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

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

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

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

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

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

if __name__ == '__main__':
    main(input().strip().split(' '))

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

diff = []
for i in range(0,2):
    diff.append(abs(ar[i + 1] - ar[i]))

diff = sorted(diff)



 

print(sum(diff))

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

Solution (Python):
A1, A2, A3 = map(int,input().split())
if A1>A2>A3 or A3>A2>A1:
    x = abs(A1-A3)
    print(x)
elif A2>A1>A3 or A3>A1>A2:
    x = abs(A2-A3)
    print(x)
else:
    x = abs(A1-A2)
    print(x)

Solution (Python):
def main(lst):
    print(max(lst)-min(lst))

lst = list(map(int,input().split()))
main(lst)

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=[int(x) for x in input().split()]
s=0
temp=max(a)
for y in sorted(a,reverse=True):
    s+=abs(temp-y)
    temp=y
print(s)

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

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

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

A1 = int(A1)
A2 = int(A2)
A3 = int(A3)

A = sorted(list((A1,A2,A3)))

cost = 0

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

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

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(sum(sorted(map(abs,[a-b,b-c,c-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-a)

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

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

Solution (Python):
A = [int(x) for x in 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()))
print(max(A) - min(A))

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

Solution (Python):



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


if __name__ == '__main__':
    main()

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):
a1, a2, a3 = map(int, input().split())
print(max(a1, a2, a3) - min(a1, a2, a3))

Solution (Python):
A=sorted([int(i) for i in input().split()])
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, b, c = sorted(map(int, input().split()), reverse=True)
print(a - c)

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

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

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

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

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


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
a = list(map(int,input().split()))
b = []
for i in range(3):
    b.append(abs(a[i-1] - a[i]))
b.remove(b[b.index(max(b))])
print(sum(b))

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

Solution (Python):
temp = input().rstrip().split(" ")
A1 = int(min(temp))
temp.remove(str(A1))
A2 = int(min(temp))
temp.remove(str(A2))
A3 = int(min(temp))
print(abs(0 + (A2 - A1) + (A3 - A2)))

Solution (Python):
import sys

def solve(A, B, C):
    
    i = [A,B,C]
    print(max(i)-min(i))

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    A = int(ws[0])
    B = int(ws[1])
    C = int(ws[2])
    return (A, B, C,)

def main():
    solve(*readQuestion())


main()

Solution (Python):
import sys


def solve(a,b,c):
    f = [a,b,c]
    f.sort()
    
    x = 0
    y = 0

    if a == b and b == c :
        return 0
    else:
        x = f[1] - f[0]
        y = f[2] - f[1]
        return x+y

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b, str_c] = line.split(' ')
    return (int(str_a), int(str_b), int(str_c))

def main():
    a, b, c = readQuestion()
    answer = solve(a, b, c)
    print(answer)
    
if __name__ == '__main__':
    main()

Solution (Python):


import sys

def solve(aOne, aTwo, aThree):
    (x, y, z) = sorted([aOne, aTwo, aThree])
    print((z - y) + (y - x))

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    aOne = int(ws[0])
    aTwo = int(ws[1])
    aThree = int(ws[2])
    return (aOne, aTwo, aThree,)

def main():
    solve(*readQuestion())

main()

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

Solution (Python):
l = list(map(int, input().split()))
l.sort()
prev = l[0]
total = 0
for n in l:
    total += abs(n - prev)
    prev = n
print(total)

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

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

ar.sort()

print(sum(ar)-ar[1]-ar[0]*2)

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

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

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

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

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

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

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


abc103_a()

Solution (Python):

a,b,c = map(int,input().split())
print("{}".format(min(abs(a-b)+abs(c-b),abs(a-c)+abs(b-c),abs(b-a)+abs(c-a))))

Solution (Python):



def main():
    """Function."""
    a1, a2, a3 = map(int, input().split())

    print(
          min([
               abs(a2 - a1) + abs(a3 - a2),
               abs(a3 - a1) + abs(a2 - a3),
               abs(a1 - a2) + abs(a3 - a1),
               abs(a3 - a2) + abs(a1 - a3),
               abs(a1 - a3) + abs(a2 - a1),
               abs(a2 - a3) + abs(a1 - a2)
                                         ])
                                          )


if __name__ == "__main__":
    main()

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

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

Solution (Python):
import itertools
a=input().split()


dict={}
for i in range(len(a)):
  dict[i]=int(a[i])


ans=1000
b=list(itertools.permutations([0, 1, 2]))
for i in range(len(b)):
  x=abs(dict[b[i][2]]-dict[b[i][1]])+abs(dict[b[i][1]]-dict[b[i][0]])
  if x < ans:
    ans = x

print(ans)

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

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

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

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

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

Solution (Python):
A = list(map(int, input().split()))
b = [[0, 1], [2, 1], [2, 0]]
l = 0
n = []
for i, j in b:
    l = l + abs(A[j]-A[i])
    n.append(abs(A[j]-A[i]))
l = l - max(n)
print(l)

Solution (Python):

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

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

Solution (Python):
A = list(map(int, input().split()))
b = [[0, 1], [2, 1], [2, 0]]
l = 0
n = []
for i, j in b:
	l = l + abs(A[j]-A[i])
	n.append(abs(A[j]-A[i]))
l = l - max(n)
print(l)

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

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

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

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

Solution (Python):

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

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()))
    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=[int(i) for i in input().split()]
a.sort()
ans=a[2]-a[0]
print(ans)

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

list_A = sorted(list_A)
x = abs(list_A[0] - list_A[1])
x += abs(list_A[2] - list_A[1])

print(x)

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

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

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

Solution (Python):
import itertools
seq=[int(i) for i in input().split()]

x=100000
listseq=list(itertools.permutations(seq))

for j in range(len(listseq)):
  y=abs(listseq[j][1]-listseq[j][0])+abs(listseq[j][2]-listseq[j][1])
  if y < x:
    x=y
print(x)

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

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

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

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

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

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

Solution (Python):
a=input().strip().split(" ")
b=[int(i) for i in a]

b.sort()

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

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

Solution (Python):


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

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

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

Solution (Python):
def solve():
    low, middle, high = sorted(list(map(int, input().split())))
    print(abs(high - middle) + abs(middle - low))


def model():
    tasks = list((map(int, input().split())))
    print(max(tasks) - min(tasks))


if __name__ == "__main__":
    
    model()

Solution (Python):
def solve():
    low, middle, high = sorted(list(map(int, input().split())))
    print(abs(high - middle) + abs(middle - low))


if __name__ == "__main__":
    solve()

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] * 0 + 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):
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):

task_list = list(map(int, input().split()))
task_list.sort()


cost = 0
task_last = task_list[0]
for i in range(len(task_list)):
    cost += abs(task_list[i] - task_last)
    task_last = task_list[i]


print(cost)

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

Solution (Python):
import numpy as np
A = np.array(sorted(list(map(int, input().split()))))
res = sum(np.abs(np.diff(A)))
print(res)

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

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

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

Solution (Python):
a,b,c = map(int, input().split())
i = abs(a - b)+abs(b - c)
i2= abs(a - c)+abs(b - c)
j = abs(a - b)+abs(a - c)
j2= abs(c - b)+abs(a - c)
k = abs(a - c)+abs(b - a)
k2= abs(c - b)+abs(b - a)
n = min(i,i2,j,j2,k,k2)
print(n)

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

Solution (Python):
A1, A2, A3 = [int(i) for i in sorted(input().split())]
print(A3-A1) if A3-A1>0 else print(A1-A3)

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

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

if a > b:
	if b > c:
		print(c)
	else:
		print(b)
else:
	if a > c:
		print(c)
	else:
		print(a)