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

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

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 += A[i+1] - A[i]

print(ans)

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

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

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

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

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

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 = sorted([a,b,c])
print(l[2]-l[0])

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

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

Solution (Python):


A = list(int(a) for a in input().split())
A.sort()

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

print(ans)

Solution (Python):
a=sorted(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 = sorted(map(int, input().split()))
print(A[-1]-A[0])

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

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

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

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

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

A = [A1, A2, A3]

A.sort()

cst1 = A[2] - A[1]

cst2 = A[1] - A[0]

cst = cst1 + cst2

print(cst)

Solution (Python):


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

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

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

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

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

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

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

Solution (Python):


a, b, c = map(int, input().split())
A = sorted([abs(a-b), abs(a-c), abs(b-c)])

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

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

print(max(As)-min(As))

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

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

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

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

print(max(alist)-min(alist))

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

lis = sorted(lis)

ans = 0

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

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

a1 = abs(a[0] - a[1])
a2 = abs(a[1] - a[2])
a3 = abs(a[2] - a[0])

m = max(a1, a2, a3)

print(a1 + a2 + a3 - m)

Solution (Python):

import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left 
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

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

res = 10000
val = 0
for i in range(2):
    val += A[i+1] - A[i]
res = min(res, val)
for i in range(2):
    val += abs(rA[i+1] - rA[i])
res = min(res, val)
print(res)

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

Solution (Python):
a,b,c = sorted([int(n) for n in 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()))
print(max(A)-min(A))

Solution (Python):
import sys
from itertools import permutations
def input(): return sys.stdin.readline().strip()


def main():
    a, b, c = map(int, input().split())
    ans = 10 ** 10
    for p, q, r in list(permutations([a, b, c], 3)):
        ans = min(ans, abs(p-q) + abs(q-r))
    print(ans)



if __name__ == "__main__":
    main()

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

Solution (Python):
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy

def main():
    lis = list(map(int, input().split()))
    lis.sort(reverse=True)
    count = 0

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

if __name__ == "__main__":
    main()

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

Solution (Python):
A1,A2,A3 = map(int, input().split())
res = 100*3
A = [A1,A2,A3]
arr = [[0,1,2], [0,2,1], [1,0,2], [1,2,0],[2,0,1], [2,1,0] ]
for a in arr:
  m = abs(A[  a[0] ] - A[a[1]])
  n = abs(  A[ a[2] ] - A[a[1]])
  if res > m + n:
    res = m + n
print(res)

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

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

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

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

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

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

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

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

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

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

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

def cost(a):
    return abs(a[0]-a[1])+abs(a[1]-a[2])

ans = sum(a)
for i in itertools.permutations(a):
    c = cost(i)
    if c < ans:
        ans = c

print(ans)

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

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

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

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

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

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

x = max(a, b, c)
y = min(a, b, c)

print(x - y)

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

print(A3-A1)

Solution (Python):
def actual(a1, a2, a3):
    A = sorted([a1, a2, a3])

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

    return amount_cost

a1, a2, a3 = map(int, input().split())
print(actual(a1, a2, a3))

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

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

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

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

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

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

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

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

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

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

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

A=[A1,A2,A3]

B=sorted(A)

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

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

sorted_A = sorted(A)

print(-sorted_A[0] + sorted_A[2])

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

a.sort()

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

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

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

    A.sort(reverse=True)

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

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
from sys import stdin

A, B, C = [int(x) for x in stdin.readline().rstrip().split()]

print(max(A,B,C)-min(A,B,C))

Solution (Python):
A_1, A_2, A_3 = (int(x) for x in input().split())
list = [A_1, A_2, A_3]
new_list = sorted(list)
print(new_list[2] - new_list[0])

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

Solution (Python):
a1,a2,a3=map(int,input().split())
a=[abs(a1-a2),abs(a1-a3),abs(a2-a3)]
a.sort()
result=0
for i in range(2):
    result+=a[i]
print(result)

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

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

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

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

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

Solution (Python):
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):
li = list(map(int, input().split()))
li.sort()
ans = 0
ans += li[2]-li[0]
print(ans)

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

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

Solution (Python):

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


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

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

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

print(sum(b))

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

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

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

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



d1=abs(a2-a1)
d2=abs(a3-a2)
d3=abs(a3-a1)

l=[d1,d2,d3]

l.sort()

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

Solution (Python):

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


A.sort()
cost = 0
for idx, a in enumerate(A):
    if idx == 0:
        continue
    else:
        cost += a - A[idx - 1]
print(cost)

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

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

x.sort()

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

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

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

c1 = abs(a2 - a1) + abs(a3 - a1)
c2 = abs(a1 - a2) + abs(a3 - a2)
c3 = abs(a1 - a3) + abs(a2 - a3)

print(min(c1, c2, c3))

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

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

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

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

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

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

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6)

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

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

ans = min(cost1,cost2,cost3)

print(ans)

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

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

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

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

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

Solution (Python):
x, y, z = map(int, input().split())
i = x + y + z
mid = i-min(x, y, z)-max(x, y, z)
print(mid - min(x, y, z) + max(x, y, z)-mid)

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    num_list = i_list()

    num_list.sort()

    min = 0
    for i in range(1,3):
        min += num_list[i] - num_list[i-1]

    print(min)
     

if __name__ == '__main__':
    main()

Solution (Python):
from itertools import combinations

def resolve():
	seq = list(map(int, input().split()))
	ans = 0
	cos = []
	comb = combinations(seq, 2)
	for el in comb:
		cos.append(abs(el[0]-el[1]))
	print(sum(cos) - max(cos))
resolve()

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

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

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

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

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

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

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

print(ans)

Solution (Python):

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

A = lr()
answer = max(A) - min(A)
print(answer)

Solution (Python):



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

Solution (Python):

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

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

Solution (Python):
import itertools

a = map(int, input().split())
ans = 1000000000000000
for p in itertools.permutations(a):

    cost = 0
    for i in range(1, len(p)):
        cost += abs(p[i] - p[i - 1])
    if ans >= cost:
        ans = cost

print(ans)

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

list = []
list.append(abs(a-b)+abs(b-c))
list.append(abs(a-c)+abs(c-b))
list.append(abs(b-a)+abs(a-c))
print(min(list))

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

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

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18


A = LI()
ans = INF
for x, y, z in permutations(A, 3):
    ans = min(ans, abs(y-x)+abs(z-y))
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(100000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():
    A = list(map(int,input().split()))
    ret = abs(A[0] - A[1]) + abs(A[1] - A[2]) + abs(A[2] - A[0])
    ans = INF
    for i in range(3):
        ans = min(ans,ret - abs(A[i] - A[(i+1)%3]))
    print(ans)

if __name__ == '__main__':
    main()

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

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

Solution (Python):
A = list(map(int, input().split()))
maxa = max(A)
A.remove(maxa)
maxa2 = max(A)
cost = maxa - maxa2
A.remove(maxa2)
cost += maxa2 - A[0]
print(cost)

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

Solution (Python):
import itertools
a, b, c = map(int, input().split())
V = itertools.permutations([a, b, c])
s = a+b+c
for v in V:
    S = abs(v[1]-v[0])+abs(v[2]-v[1])
    if S < s:
        s = S
print(s)

Solution (Python):
a = [int(i) for i in 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):
l = list(map(int, input().split()))
l.sort()
print(l[2] - l[0])

Solution (Python):
from math import fabs

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

def func(a,b,c):
    cost = 0
    cost += fabs(A_num[b]-A_num[a])
    cost += fabs(A_num[c]-A_num[b])

    return cost

print(int(min(func(0,1,2),func(0,2,1),func(1,0,2),func(1,2,0),func(2,0,1),func(2,1,0))))

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

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

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

Solution (Python):

"""
Created on Wed May 13 16:37:43 2020

@author: shinba
"""

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

Solution (Python):






import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr


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





A = inputIL()

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

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

Solution (Python):
import sys
import math
import bisect

def main():
    A = list(map(int, input().split()))
    B = []
    for i in range(3):
        for j in range(3):
            for k in range(3):
                if j != i and k != i and k != j:
                    val = abs(A[j] - A[i]) + abs(A[k] - A[j])
                    B.append(val)
    print(min(B))

if __name__ == "__main__":
    main()

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

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

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

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

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

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

Solution (Python):
from itertools import permutations

a_list = [int(x) for x in input().split()]

ans = sum(a_list)
for temp in list(permutations(a_list)):
    temp_ans = abs(temp[1] - temp[0]) + abs(temp[2] - temp[1])
    if temp_ans < ans:
        ans = temp_ans
print(ans)

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())
l=[a1,a2,a3]
l.sort()
print(l[2]-l[0])

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

    cost1 = 0 + abs(A2-A3) + abs(A3-A1)
    cost2 = 0 + abs(A2-A1) + abs(A3-A2)
    cost3 = abs(A1-A2) + 0 + abs(A3-A1)
    cost4 = abs(A1-A3) + 0 + abs(A3-A2)
    cost5 = abs(A1-A3) + abs(A2-A1) + 0
    cost6 = abs(A1-A2) + abs(A2-A3) + 0

    print(min(cost1,cost2,cost3,cost4,cost5,cost6))

if __name__ == '__main__':

    ABC_103_A()

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(key=int)
print((A[1]-A[0])+(A[2]-A[1]))

Solution (Python):
A = list(map(int, input().split()))
cost = 0
dif_1to2 = abs(A[0]-A[1])
dif_1to3 = abs(A[0]-A[2])
dif_2to3 = abs(A[1]-A[2])
dif = [dif_1to2,dif_1to3,dif_2to3]
print(sum(dif)-max(dif))

Solution (Python):
import sys

input = sys.stdin.readline


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

    cost_1 = abs(A[1] - A[0]) + abs(A[2] - A[1])
    cost_2 = abs(A[2] - A[0]) + abs(A[1] - A[2])
    cost_3 = abs(A[0] - A[1]) + abs(A[2] - A[0])
    cost_4 = abs(A[2] - A[1]) + abs(A[0] - A[2])
    cost_5 = abs(A[0] - A[2]) + abs(A[1] - A[0])
    cost_6 = abs(A[1] - A[2]) + abs(A[0] - A[1])

    ans = min(cost_1, cost_2, cost_3, cost_4, cost_5, cost_6)
    print(ans)


if __name__ == "__main__":
    main()

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

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

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

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

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

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

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

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

Solution (Python):
from itertools import permutations 
a = [int(i) for i in input().split()]
p = permutations(a,3)
mn = 10**10
for i in p:
    cost = 0
    cost += abs(i[0]-i[1])
    cost += abs(i[1]-i[2])
    mn = min(mn,cost)
print(mn)

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

print( c - a)

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

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

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

Solution (Python):

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

print(A3-A1)

Solution (Python):


import sys






















def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    a, b, c = mi()
    L = [a, b, c]
    L.sort()
    print(L[-1] - L[0])


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
a,b,c = map(int,input().split())
a1 = abs(b-a)+abs(c-b)
a2 = abs(c-a) + abs(b-c)
b1 = abs(a-b) + abs(c-a)
b2 = abs(b-c) + abs(a-c)
c1 = abs(c-a) + abs(b-a)
c2 = abs(c-b) + abs(a-b)
print(min(a1,a2,b1,b2,c1,c2))

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

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

Solution (Python):
a,b,c=map(int,input().split())
ans=max(a,b,c)-min(a,b,c)
print(str(ans)+"\n")

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

costs.sort()
diff = [(costs[i + 1] - costs[i]) for i in range(len(costs) - 1)]

ans = sum(diff)

print(ans)

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

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

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

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)