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

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    A = LI()
    A = sorted(A)
    ans = 0
    ans += A[1] - A[0] + A[2] - A[1]
    print(ans)

main()

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

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

min_n = min(a, b, c)
max_n = max(a, b, c)

cost_min = (max_n - min_n)
print(cost_min)

Solution (Python):


def get_input() -> list:
    """
    標準入力を取得する.

    Returns:\n
        list: 標準入力
    """
    A = list(map(int, input().split()))

    return A


def main(A: list) -> None:
    """
    メイン処理.

    Args:\n
        A (list): 整数列(1 <= A_i <= 100)
    """
    
    ans = max(A) - min(A)

    
    print(ans)


if __name__ == "__main__":
    
    A = get_input()

    
    main(A)

Solution (Python):


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


ans = max(A) - min(A)


print(ans)

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

Solution (Python):
import math
a=list(map(int, input().split()))
q=[]
for i in range(3):
  for j in range(3):
    if not i==j:
      q.append(abs(a[i]-a[j])+abs(a[j]-a[3-(i+j)]))
print(min(q))

Solution (Python):
import numpy as np
N_List = np.array(list(map(int,input().split())))
N_List_a = np.sort(N_List)
print(sum(N_List_a[1:]-N_List_a[:-1]))

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

Solution (Python):

import sys
import itertools


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


ans = sys.maxsize
for A_1, A_2, A_3 in itertools.permutations(A, r=3):
    ans = min(ans, abs(A_2 - A_1) + abs(A_3 - A_2))


print(ans)

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

a.sort()

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

Solution (Python):


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


if __name__ == "__main__":
    main()

Solution (Python):
def mapt(fn, *args):
    return list(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    a, b, c = Input()
    x, y, _ = sorted([abs(a-b), abs(b-c), abs(a-c)])
    print(x + y)


main()

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

li.sort()

n = (li[1] - li[0])+(li[2] - li[1])
print(n)

Solution (Python):
a = [int(x) for x in input().split()]
a1 = abs(a[1] - a[0]) + abs(a[1] - a[2])
a2 = abs(a[2] - a[0]) + abs(a[2] - a[1])
a3 = abs(a[2] - a[0]) + abs(a[1] - a[0])
print(min(a1,a2,a3))

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

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

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

print(max(s) - min(s))

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

print(max(s) - min(s))

Solution (Python):
al = list(map(int,input().split()))
s = []
for i in range(3):
  s.append(abs(al[-i]-al[1-i])+abs(al[1-i]-al[2-i]))
print(min(s))

Solution (Python):
import sys
import math


sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

tasks = inl()
tasks.sort()
ans = 0
for i in range(len(tasks)-1):
    ans += tasks[i+1] - tasks[i]

print(ans)

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

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

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

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

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

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

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

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

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

Solution (Python):
A = list(map(int, input().split()))
line = [[0, 1, 2], [0, 2, 1], [1, 0, 2], 
        [1, 2, 0], [2, 0, 1], [2, 1, 0]]
ans = sum(A)

for i in range(len(line)):
  tmp = 0
  for j in range(1,3):
    tmp += abs(A[line[i][j]] - A[line[i][j-1]])
  ans = min(ans, tmp)
print(ans)

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

Solution (Python):
A = list(map(int, input().split()))
A.sort(reverse=True)
cur = A.pop(0)
ans = 0
for a in A:
    ans += (cur - a)
    cur = a

print(ans)

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

print(ret)

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

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

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

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

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

list_int.sort()
min_num = min(list_int)
max_num = max(list_int)
mid_num = list_int.pop(1)

minimum_cost = abs(mid_num - min_num) + abs(max_num - mid_num)
print(minimum_cost)

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

min_num = min(list_int)
max_num = max(list_int)
mid_num = list_int.pop(1)

minimum_cost = abs(mid_num - min_num) + abs(max_num - mid_num)
print(minimum_cost)

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    A = LI()

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

if __name__ == '__main__':
    resolve()

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

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

per_ls = list(permutations(A))

ans = float("inf")
for (a,b,c) in per_ls:
  tmp = 0 + abs(a - b) + abs(b - c)
  ans = min(ans, tmp)
  
print(ans)

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

Solution (Python):
def main():
    a, b, c = map(int, input().split())
    d, e, f = abs(a - b), abs(b - c), abs(c - a)

    print(min(d + e, e + f, f + d))


if __name__ == "__main__":
    main()

Solution (Python):
from itertools import permutations
A = list(map(int, input().split()))
p = permutations([0, 1, 2])
ans = 10**9
for pi in p:
    t0 = pi[0]
    t1 = pi[1]
    t2 = pi[2]
    tmp = abs(A[t1] - A[t0]) + abs(A[t2] - A[t1])
    ans = min(ans, tmp)
print(ans)

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

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

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

ans=abs(b-a)+abs(c-b)
ans2=abs(c-a)+abs(b-c)
if(ans2<ans):
    ans=ans2

ans2=abs(a-b)+abs(c-a)
if(ans2<ans):
    ans=ans2
ans2=abs(c-b)+abs(a-c)
if(ans2<ans):
    ans=ans2

ans2=abs(a-c)+abs(b-a)
if(ans2<ans):
    ans=ans2
ans2=abs(b-c)+abs(a-b)
if(ans2<ans):
    ans=ans2
print(ans)

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    X = list(map(int, readline().split()))

    print(max(X) - min(X))


if __name__ == '__main__':
    main()

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

print(ans)

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

for i, a in enumerate(A123):
    for j, b in enumerate(A123):
        for k, c in enumerate(A123):
            if i != j and j != k and k != i:
                tmp = abs(b - a) + abs(c - b)
                if tmp < ans:
                    ans = tmp

print(ans)

Solution (Python):

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

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):
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):
a = map(int, input().split())
a = sorted(a)
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])
m = max(x, y, z)
if m == x:
  print(y+z)
elif m == y:
  print(x+z)
else:
  print(x+y)

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

Solution (Python):
list=input().split(" ")
list_n=[int(s) for s in list]
print(int(max(list_n))-int(min(list_n)))

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

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

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

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

print(ans)

Solution (Python):

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

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

L = sorted([x, y, z])

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

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

Solution (Python):
a=list(map(int,input().split()))
a.sort()
ans=0 if len(set(a))==1 else a[2]-a[0]
print(ans)

Solution (Python):
from itertools import permutations
res = float("inf")
for a, b, c in permutations(map(int, input().split()),3):
    res = min(abs(b-a) + abs(c-b),res)
print(res)

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

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

Solution (Python):

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


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

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

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

Solution (Python):
import itertools

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

choice_lst = list(itertools.permutations(a_lst, 3))

cost_lst = []
for i in range(len(choice_lst)):
    cost = 0
    for j in range(3):
        tmp_cost = choice_lst[i][j]
        if j == 0:
            continue
        else:
            cost += abs(choice_lst[i][j] - choice_lst[i][j - 1])
    cost_lst.append(cost)

minimum = min(cost_lst)
print(minimum)

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

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

print(min(d1 + d2, d2 + d3, d3 + d1))

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())
i = abs(a - b)
j = abs(a - c)
k = abs(b - c)
lst = sorted([i, j, k])
print(lst[0] + lst[1])

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

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

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

res = [abs(a-b), abs(a-c), abs(b-c)]

print(sum(res)-max(res))

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

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

Solution (Python):
import itertools
a = list(map(int, input().split()))
res = sum(a)
for i in itertools.permutations(a):
    a1, a2, a3 = i
    tmp = abs(a1 - a2) + abs(a2 - a3)
    res = min(res, tmp)
print(res)

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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    A = sorted(nl())
    D = [A[i + 1] - A[i] for i in range(2)]
    print(sum(D))


if __name__ == '__main__':
    main()

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

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

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

    return


if __name__ == '__main__':
    main()

Solution (Python):









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

c1 = abs(a-b)
c2 = abs(a-c)
c3 = abs(c-b)

print(c1+c2+c3-max(c1,c2,c3))

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

l = []

s = 0
s += abs(b - a)
s += abs(c - b)
l.append(s)

s = 0
s += abs(c - a)
s += abs(b - c)
l.append(s)

s = 0
s += abs(a - b)
s += abs(c - a)
l.append(s)

s = 0
s += abs(c - b)
s += abs(a - c)
l.append(s)

s = 0
s += abs(a - c)
s += abs(b - a)
l.append(s)

s = 0
s += abs(b - c)
s += abs(a - b)
l.append(s)

print(min(l))

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

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

Solution (Python):

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


if __name__ == "__main__":
    main()

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

Solution (Python):
a1, a2, a3 = map(int, input().split())
if (a1 <= a2 and a2 <= a3) or (a3 <= a2 and a2 <= a1):
    print(abs(a2 - a1) + abs(a3 - a2))
elif (a2 <= a1 and a1 <= a3) or (a3 <= a1 and a1 <= a2):
    print(abs(a1 - a2) + abs(a3 - a1))
else:
    print(abs(a3 - a1) + abs(a2 - a3))

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


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

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

Solution (Python):
n=list(map(int,input().split()));print(sum(sorted([abs(n[i]-n[j]) for i in range(3) for j in range(i+1,3)])[:2]))

Solution (Python):
ar = [int(i) for i in input().strip().split(" ")]
ar.sort()
s = 0
for i in range(1, len(ar)):
    s += (ar[i] - ar[i - 1])
print(s)

Solution (Python):
ar=[int(i) for i in input().strip().split(" ")]
ar.sort()
s=0
for i in range(1,len(ar)):
    s+=(ar[i]-ar[i-1])
print(s)

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

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

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

print(saidai - mini)

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

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

Solution (Python):


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

a.sort(reverse=True)

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

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

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

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

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

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

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

Solution (Python):
a = [int(s) for s in input().split()]
max_id = a.index(max(a[0], a[1], a[2]))
min_id = a.index(min(a[0], a[1], a[2]))
sum = 0
sum += abs(a[0] - a[1])
sum += abs(a[1] - a[2])
sum += abs(a[2] - a[0])
sum -= abs(a[max_id] - a[min_id])
print(sum)

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

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

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

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

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

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

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

Solution (Python):
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

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

print(ans)

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

Solution (Python):


















































def calculation(lines):
    values = list(map(int, lines[0].split()))
    mi = min(values)
    ma = max(values)
    return [ma - mi]



def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['1 6 3']
        lines_export = [5]
    if pattern == 2:
        lines_input = ['11 5 5']
        lines_export = [6]
    if pattern == 3:
        lines_input = ['100 100 100']
        lines_export = [0]
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode



def main():
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

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

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

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

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

print(ans)

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

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

Solution (Python):
if __name__ == '__main__':
	
	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[1]+l[1]-l[0])

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()
ans=0
for i in range(1,3):
    ans+=abs(a[i]-a[i-1])
print(ans)

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

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

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

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

Solution (Python):
import itertools

aa = tuple(sorted(map(int, input().split())))
ans = 10 ** 10
for a in itertools.permutations(aa, 3):
    ans = min(ans, abs(a[0] - a[1]) + abs(a[1] - a[2]))
print(ans)

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

orders = [[0, 1, 2], [0, 2, 1], [1, 0, 2], [1, 2, 0], [2, 0, 1], [2, 1, 0]]
ans = []

for order in orders:
    cost = abs(A[order[0]] - A[order[1]]) + abs(A[order[1]] - A[order[2]])
    ans.append(cost)
    
print(min(ans))

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

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

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

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

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

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

Solution (Python):
import itertools
a1, a2, a3 = map(int, input().split())
ans = 10 ** 9
for v in itertools.permutations([a1, a2, a3]):
    d = 0
    for i in range(1, 3):
        d += abs(v[i]-v[i-1])
    ans = min(ans, d)

print(ans)

Solution (Python):
ais = map(int, raw_input().split()) 
ais.sort()
print sum([v-  u for u,v in zip(ais, ais[1:])])

Solution (Python):
aa = list(map(int, open(0).read().split()))

print(max(aa) - min(aa))

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

Solution (Python):
def main():
    a=sorted(map(int,input().split()))
    print(abs(a[1]-a[0]) + abs(a[2]-a[1]))
    
if __name__ == "__main__":
    main()

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

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

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

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

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

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

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

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

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

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

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

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

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

lists = [a,b,c]

x = max(lists)

lists.remove(x)

y = max(lists)

lists.remove(y)

print(int(abs(y-x)) + int(abs(lists[0] - y)))

Solution (Python):
from itertools import permutations
A = list(map(int, input().split()))
res = 10 ** 4
for perm in permutations(list(range(3))):
    tmp = 0
    for i in range(1, 3):
        tmp += abs(A[perm[i]] - A[perm[i-1]])
    res = min(res, tmp)
print(res)

Solution (Python):
A = sorted([int(X) for X in input().split()],reverse=True)
Cost = [0]+[A[X]-A[X+1] for X in range(0,len(A)-1)]
print(sum(Cost))

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

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

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

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-1]-A[i])
print(ans)

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

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

a_lst.sort()

total = 0
previous = a_lst[0]
for i in a_lst[1:]:
    total += (i - previous)
    previous = i

print(total)

Solution (Python):
line = list(input().split())
line.sort()
if int(line[1]) - int(line[0]) > int(line[2]) - int(line[1]):
    print((int(line[2]) - int(line[1]) + (int(line[1]) - int(line[0]))))
else:
    print(abs((int(line[2]) - int(line[1]) + (int(line[1]) - int(line[0])))))

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

arr.sort()

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

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

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

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

print(ans)

Solution (Python):

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



from itertools import permutations
Ls = list(permutations(A))

ans=100000000
for L in Ls:
    
    cost=0
    for i in range(1,3):
        cost+=abs(L[i]-L[i-1])
        
    
    ans = min(ans,cost)

print(ans)

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

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

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


if __name__ == "__main__":
    solve()

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

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

Solution (Python):
import sys
A1,A2,A3 = map(int,input().split())
array_A = [A1,A2,A3]

if not (1 <= A1 <= 100 and 1 <= A2 <= 100 and 1 <= A3 <= 100):
    sys.exit()

print(max(array_A) - min(array_A))

Solution (Python):
import sys
rl = lambda: list(map(int, sys.stdin.readline().split()))

a = sorted(rl())
print(a[2] - a[0])

Solution (Python):
import sys
rl = lambda: list(map(int, sys.stdin.readline().split()))

a = sorted(rl())
print(a[-1] - a[0])

Solution (Python):
import sys
rl = lambda: list(map(int, sys.stdin.readline().split()))

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

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

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

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


a12 = abs(a1 - a2)
a13 = abs(a1 - a3)
a23 = abs(a2 - a3)

max_num = max(a12,a13, a23)

print(a12 + a13 + a23 - max_num)

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

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

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

print(ans)

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