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

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

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

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

Solution (Python):






def main():
    A = list(map(int, input().split()))
    tasks = [[0, 1, 2], [0, 2, 1], [1, 2, 0], [1, 0, 2], [2, 0, 1], [2, 1, 0]]

    ans = 10000000
    for task in tasks:
        cand = abs(A[task[1]]-A[task[0]]) + abs(A[task[2]]-A[task[1]])
        if cand < ans:
            ans = cand
    
    return ans


print(main())

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

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

Solution (Python):

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

a.sort()
cnt = 0

for i in range(1,3):
  cnt += a[i] - a[i-1]
print(cnt)

Solution (Python):

def inputlist(): return [int(k) for k in input().split()]

A = inputlist()
A.sort(reverse=True)
ans = 0
for i in range(1,3):
    ans += A[i-1]-A[i]
print(ans)

Solution (Python):
from sys import stdin

a = sorted([int(x) for x in stdin.readline().rstrip().split()])
print(abs(a[0] - a[1]) + abs(a[1] - a[2]))

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

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

Solution (Python):
import numpy as np

a = list(map(int, input().split()))
def task(b):
    return abs(b[1] - b[0]) + abs(b[2] - b[1])
a = np.array(a)
p = np.array([[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]) - 1
Min = np.inf
for i in range(6):
    Min = min(Min, task(a[p[i,:]]))
print(Min)

Solution (Python):

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

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

ans = 0

a0 = min(a_list)
a_list.remove(a0)
a1 = min(a_list)
a_list.remove(a1)
ans += abs(a1 - a0)
a2 = min(a_list)
ans += abs(a2 - a1)

print(ans)

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

Solution (Python):
import itertools

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

p = list(itertools.permutations(range(3) ) )     

cst=sum(A)
for i in range(3):
  c=abs(A[p[i][1]]-A[p[i][0]])+abs(A[p[i][2]]-A[p[i][1]])
  if c<=cst:
    cst=c
print(cst)

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

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

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

cost = max(a) - min(a)
print(cost)

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

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

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):
a1,a2,a3 = map(int,input().split())
list = [a1,a2,a3]
list.sort()

x = list[0]
y = list[1]
z = list[2]

print(- x + z)

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()
a=(A[1]-A[0])+(A[2]-A[1])
print(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,b,c = map(int, input().split())
ans1 = abs(a-b)+abs(b-c)
ans2 = abs(b-c)+abs(c-a)
ans3 = abs(c-a)+abs(a-b)

print(min(ans1, ans2, ans3))

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

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

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

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

Solution (Python):
x = sorted(input().split(), reverse=True)
a = (int(x[0])-int(x[1])) + (int(x[1])-int(x[2]))
if a < 0:
  a = a*-1
print(a)

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

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

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

Solution (Python):

import sys
try:
    from typing import List
except ImportError:
    pass


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


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

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 accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce 
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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A = LIST()
print(max(A)-min(A))

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 accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce 
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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A = LIST()
A.sort(reverse=True)
print(min(abs(A[0]-A[1])+abs(A[1]-A[2]), abs(A[0]-A[2])+abs(A[2]-A[1])))

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

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

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

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

sm = 0
num1 = A.pop(A.index(min(A)))
num2 = A.pop(A.index(min(A)))
num3 = A.pop(A.index(min(A)))

sm += abs(num2 - num1)
sm += abs(num3 - num2)

print(sm)

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

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

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

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

Solution (Python):
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math
import functools

a = list(map(int,input().split()))
li = []
for i in range(len(a)):
    for j in range(i+1,len(a)):
        cost = abs(a[i]-a[j])
        li.append(cost)
li.sort()
li[-1] = 0
print(sum(li))

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

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

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

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

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

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

if __name__ == '__main__':
    main()

Solution (Python):
def main():
    A, B, C = map(int, input().split())
    Task = sorted([A, B, C])
    print(Task[-1]-Task[0])
if __name__ == "__main__":
    main()

Solution (Python):
a1, a2, a3 = map(int, input().split())
elem1 = abs(a2 - a1) + abs(a3 - a2) 
elem2 = abs(a3 - a1) + abs(a2 - a3)
elem3 = abs(a1 - a2) + abs(a3 - a1)
elem4 = abs(a3 - a2) + abs(a1 - a3)
elem5 = abs(a1 - a3) + abs(a2 - a1)
elem6 = abs(a2 - a3) + abs(a1 - a2)
lst = [elem1, elem2, elem3, elem4, elem5, elem6]

print(min(lst))

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):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

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


if __name__ == '__main__':
    main()

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

mini = 0
mini += abs(a2-a1)
mini += abs(a3-a2)
ans.append(mini)


mini = 0
mini += abs(a3-a1)
mini += abs(a2-a3)
ans.append(mini)


mini = 0
mini += abs(a1-a2)
mini += abs(a3-a1)
ans.append(mini)

print(min(ans))

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

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

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

li_2 = [li[2] - li[1],li[1] - li[0]]

print(sum(li_2))

Solution (Python):
from itertools import permutations , combinations
a  = list(map(int , input().split()))
p = permutations(a,3)
ans = 999999999
for i in p:
    cost = 0
    for idx in range(1,3):
        cost += abs(i[idx] - i[idx-1])
    ans = min(cost , ans)
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),
    abs(b-c) + abs(c-a),
    abs(c-a) + abs(a-b),
    abs(c-b) + abs(b-a)
))

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

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

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

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

Solution (Python):

import sys

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

    return
            



if __name__ == '__main__':
    main()

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

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

a.sort()
ans = 0

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

print(ans)

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

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

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

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

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

Solution (Python):
a,b,c=map(int,input().split())
if a>=b>=c:
    print(a-c)
elif a>=c>=b:
    print(a-b)
elif b>=a>=c:
    print(b-c)
elif b>=c>=a:
    print(b-a)
elif c>=a>=b:
    print(c-b)
else:
    print(c-a)

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

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

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

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

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

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

Solution (Python):
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

a = nl()

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

Solution (Python):
icase=103
if icase==103:
    a1,a2,a3=map(int,input().split())
    a=min(abs(a2-a1)+abs(a3-a2),abs(a3-a2)+abs(a1-a3),abs(a1-a3)+abs(a2-a1))
    print(a)

Solution (Python):
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))

def main():
    a,b,c = sorted(MII())
    cst = b-a + c-b
    print(cst)

if __name__ == '__main__':
    main()

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

b = sorted(a)

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

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

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

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

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

Solution (Python):
import math
import collections
import sys
 

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
 
AS=LI()
AS=sorted(AS)
ans=AS[2]-AS[0]
print(ans)

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

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

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

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

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

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

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

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

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

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

Solution (Python):

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

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

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

l = [a1, a2, a3]
l.sort()

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

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

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

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(a1-a3),abs(a3-a1)+abs(a1-a2),abs(a3-a2)+abs(a2-a1)))

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):
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[1] + A[1] - 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=sorted(a)
x=0
for i in range(len(a)-1):
    x+=abs(a[i]-a[i+1])
print(x)

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

Solution (Python):
import io
import math

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

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

print(abs(a-c))

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

A_max = max(A)
A_min = min(A)

print(A_max - A_min)

Solution (Python):
a = list(map(int,input().split()))
 
a.sort()
ans = 0
 
for i in range(1,len(a)):
    ans += a[i]-a[i-1]
    
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(A1 - A3) + abs(A3 - A2), abs(A2 - A1) + abs(A1 - A3), abs(A3 - A2) + abs(A2 - A1), abs(A3 - A1) + abs(A1 - A2)))

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

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

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

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

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

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

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

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

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

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

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

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

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

for ii in range(2):
  a=min(b)
  for i in range(len(b)):
    if min(b)==b[i]:
      del b[i]
      break
  b=[abs(x-a) for x in b]
  cost+=min(b)
print(cost)

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

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

a.sort()
ans = 0

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

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

if '__main__' == __name__:
    resolve()

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

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

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

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

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

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

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

Solution (Python):
a,b,c= input().split()
x,y,z=(int(a),int(b),int(c))
sample_list = [x,y,z]
abs_list = [abs(x-y),abs(x-z),abs(y-z)]
abs_max = max(abs_list)
abs_min = min(abs_list)
print(abs_max)

Solution (Python):
Alist = list(map(int,input().split()))
p = [0,0,0,0,0,0]
p[0] = abs(Alist[0] - Alist[1]) + abs(Alist[1] - Alist[2])
p[1] = abs(Alist[0] - Alist[2])+ abs(Alist[1] - Alist[2])
p[2] = abs(Alist[1] - Alist[2])+ abs(Alist[0] - Alist[2])
p[3] = abs(Alist[1] - Alist[0])+ abs(Alist[0] - Alist[2])
p[4] = abs(Alist[0] - Alist[2])+ abs(Alist[1] - Alist[0])
p[5] = abs(Alist[2] - Alist[1])+ abs(Alist[1] - Alist[0])
print(min(p))

Solution (Python):
import itertools

A = list(itertools.permutations(map(int, input().split())))
ans = 1000
for a in A:
  cost = 0 + abs(a[0]-a[1]) + abs(a[1]-a[2])
  ans = min(ans, cost)

print(ans)

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


lines.sort()

cnt =0
for i in range(len(lines)):
    cnt += lines[2-i]

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

Solution (Python):
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect




from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
from datetime import datetime as dt

def main():
  a = list(map(int, readline().split()))
  a.sort(reverse=True)
  ans = 0
  for i in range(len(a)-1):
    ans += a[i]-a[i+1]
  print(ans)
  
  
  
if __name__ == '__main__':
  main()

Solution (Python):

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

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

a = LI()
a.sort(reverse=1)
ans = a[0] - a[2]
print(ans)

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

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

Solution (Python):
a,b,c = map(int,input().split())
d = [abs(a-b),abs(b-c),abs(c-a)]
ans = 100000
for i in range(2):
    for j in range(i+1,3):
        ans = min(ans,d[i]+d[j])
print(ans)

Solution (Python):
import itertools
import fractions
def main():
  A = list(map(int,input().split()))
  A_ = sorted(A)
  dp = [0]*3
  dp[0] = 0
  for i in range(2):
    dp[i + 1] = dp[i] + (A_[i+1]-A_[i])
  print(dp[2])
if __name__ == '__main__':
  main()

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

Solution (Python):
A = list(map(int, input().split()))
C = [0] * 3
N = [0,1,2,0,1]
for i in range(3):
  a = N[i]
  b = N[i+1]
  c = N[i+2]
  C[i] += ( abs(A[b]-A[a]) + abs(A[c]-A[b]) )
print(min(C))

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

Solution (Python):
def Task(al):

    return max(al) - min(al)

def main():
    al = list(map(int , input().split()))
    print(Task(al))

if __name__ == '__main__':
    main()

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

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

def main():
    print(a[-1] - a[0])

if __name__ ==  '__main__':
    main()

Solution (Python):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

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

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

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b,c = iim()
ab = abs(a-b)
bc = abs(c-b)
ca = abs(a-c)
print(ab+bc+ca-max(ab,bc,ca))

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()
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)
 
if x + y <= y + z and x + y <= z + x:
	print(x + y )
elif y + z <= x + y and  y + z <= z + x:
	print(y + z )
else:
	print(z + x)

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

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

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

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

Solution (Python):
import math

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

print(c-a)

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

A.sort()
ans = 0

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

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

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

Solution (Python):


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



if __name__ == "__main__":
    solve()

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

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

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

ans = float('inf')
for a1, a2, a3 in permutations(A, 3):
    tmp = abs(a2-a1)+abs(a3-a2)
    ans = min(ans, tmp)

print(ans)

Solution (Python):
a = list(map(int, input().split()))
x = abs(a[0] - a[1]) + abs(a[1] - a[2])
y = abs(a[0] - a[2]) + abs(a[1] - a[2])
z = abs(a[0] - a[1]) + abs(a[0] - a[2])
print(min(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())
num1 = max(a,b,c)
num2 = min(a,b,c)
print(num1-num2)

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

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

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

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

Solution (Python):
A1,A2,A3 = map(int, input().split())
t1 = abs(A1-A2)
t2 = abs(A2-A3)
t3 = abs(A3-A1)

print(min((t1+t2),(t2+t3),(t3+t1)))

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

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

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

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

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

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

Solution (Python):
a, b, c = map(int, input().split())
Max = max(a, b, c)
Min = min(a, b, c)
Mid = a + b + c - Max - Min

d = abs(Max -Mid) + abs(Mid - Min)
e = abs(Mid - Min) + abs(Min - Max)
print(min(d, e))

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

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

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

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

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

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

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

D = abs(A-B)
E = abs(A-C)
F = abs(B-C)

print(D+E+F-max(D,E,F))

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

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

Solution (Python):
def LI():
	return [ int(s) for s in input().split() ]
 
A = LI()
 
A12 = abs(A[0]-A[1])
A23 = abs(A[1]-A[2])
A31 = abs(A[2]-A[0])
 
print(min(A12+A23,A23+A31,A31+A12))

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

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

l.sort()

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

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

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

if a[0]==a[1]==a[2]:
  print(0)
else:
  ans=sorted(a)[-2]-min(a)
  ans+=max(a)-sorted(a)[-2]
  print(ans)

Solution (Python):
from itertools import permutations as per


def main():
    a1, a2, a3 = map(int, input().split())
    As = list(per([a1, a2, a3], 3))
    ans = float("inf")
    for A in As:
        ans = min(ans, abs(A[0] - A[1])+abs(A[1] - A[2]))

    print(ans)


if __name__ == "__main__":
    main()

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

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

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

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

Solution (Python):
x,y,z = sorted(map(int, input().split()))
print((y-x)+(z-y))

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

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

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

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