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

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

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

b1 = abs(a[0] - a[1]) + abs(a[1] - a[2])
b2 = abs(a[1] - a[2]) + abs(a[2] - a[0])
b3 = abs(a[2] - a[0]) + abs(a[0] - a[1])
b4 = abs(a[0] - a[2]) + abs(a[2] - a[1])
b5 = abs(a[1] - a[0]) + abs(a[0] - a[2])
b6 = abs(a[2] - a[1]) + abs(a[1] - a[0])

print(min([b1, b2, b3, b4, b5, b6]))

Solution (Python):
import itertools

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

ans = 1000
for a, b, c in itertools.permutations(A):
    temp = abs(b - a) + abs(c - b)
    if temp < ans:
        ans = temp 

print(ans)

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

Solution (Python):
import math

li=list(map(int, input().split()))
    
cost=10000

c = abs(li[0] - li[1]) + abs(li[2] - li[1])

if c < cost:
    cost=c

c = abs(li[0] - li[2]) + abs(li[2] - li[1])

if c < cost:
    cost = c
    
c = abs(li[0] - li[1]) + abs(li[2] - li[0])

if c < cost:
    cost = c

c = abs(li[2] - li[1]) + abs(li[2] - li[0])

if c < cost:
    cost = c

c = abs(li[2] - li[0]) + abs(li[0] - li[1])

if c < cost:
    cost = c

c = abs(li[2] - li[1]) + abs(li[0] - li[1])

if c < cost:
    cost = c

print(cost)

Solution (Python):


import numpy as np

A = [int(i) for i in input().split()]

A = np.array(sorted(A))

print(sum(A[1:] - A[:2]))

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 = max(a1, a2, a3)
y = min(a1, a2, a3)
print(x - y)

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

Solution (Python):
As = input().split(' ')

As.sort()

sumup = 0
tik = int(As[0])
for A in  As:
    A = int(A)
    tok = A
    sumup += tik - tok
    tik = tok
print(abs(sumup))

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

Solution (Python):
import math, string, fractions, heapq, re, array, bisect, sys, random, time, copy
import itertools as it
import collections as cl
import functools as ft


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


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

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

print(max(tasks) - min(tasks))

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

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

print(min(ans))

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

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

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

print(ans)

Solution (Python):
a,b,c = map(int,input().split())
aa = abs(a-b)
bb = abs(b-c)
cc = abs(c-a)

l = [aa,bb,cc]
l.sort()

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

Solution (Python):
import itertools as it
import collections as col

import sys
sys.setrecursionlimit(10000)

def main():
    x = [int(x) for x in input().split()]
    x = sorted(x)
    
    s = 0
    for i in range(1, len(x)):
        s += x[i] - x[i-1]
    
    print(s)

if __name__ == '__main__':
    main()

Solution (Python):
a1,a2,a3=map( int, raw_input().split() ) 
print min( abs(a1-a2)+abs(a2-a3), abs(a1-a2)+abs(a1-a3), abs(a2-a3)+abs(a1-a3) )

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

A.sort()

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

print(ret)

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

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

tasks_s = list(sorted(tasks, reverse=True))
cost = 0
for i, j in enumerate(tasks_s[:-1]):
    cost += abs(j - tasks_s[i+1])

print(cost)

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

total = 0
tmp = 0
for i in range(3):
    if i == 0:
        total += 0
    else:
        total += abs(tmp-min(A))
    tmp = min(A)
    A.remove(min(A))

print(total)

Solution (Python):
a,b,c = input().split(" ")
list = []
list.append(int(a))
list.append(int(b))
list.append(int(c))

list.sort()

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


print(ans)

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

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

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

Solution (Python):
import itertools
A=[int(i) for i in input().split()]
S=list(itertools.permutations(A,3))
ans=30000
for sg in S:
    tmp=0
    tmp+=abs(sg[1]-sg[0])
    tmp+=abs(sg[2]-sg[1])
    if tmp<ans:
        ans=tmp
print(ans)

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

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

print(S)

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

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

Solution (Python):
inputs = list(map(int, input().split(' ')))
inputs.sort()
s = 0
for i in range(len(inputs)):
    if i == 0:
        continue
    s += inputs[i] - inputs[i-1]
print(s)

Solution (Python):
import itertools

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

for a,b,c in itertools.permutations(A):
    cost = abs(b-a)+abs(c-b)
    if cost < ans:
        ans = cost

print(ans)

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

print(min(A+B,B+C,C+A))

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

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

a.sort()

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

print(result)

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

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

Solution (Python):
def run():
	nmls = [int(x) for x in input().split()]
	nmls.sort()
	print(nmls[2] - nmls[0])

if __name__ == '__main__':
	run()

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

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

for i, j, k in [(0,1,2), (0,2,1), (1,0,2), (1,2,0), (2,0,1), (2,1,0)]:
    ans = min([ans, abs(a[j]-a[i])+abs(a[k]-a[j])])

print(ans)

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

l = sorted(l)
cost_1 = abs(l[1] - l[0])
cost_2 = abs(l[2] - l[1])
r = cost_1 + cost_2
print(r)

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

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

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

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

print(ans)

Solution (Python):
import numpy as np


a, b, c = map(int, input().split())
d = np.abs(a-b)
e = np.abs(b-c)
f = np.abs(c-a)
ans = [d+e, e+f, f+d]
print(min(ans))

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

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

    ans = min([c1, c2, c3])
    print(ans)


if __name__ == '__main__':
    main()

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

Solution (Python):


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

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

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

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

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

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

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

Solution (Python):



lis = sorted([int(i) for i in input().split()])
print((lis[1] - lis[0]) + (lis[2] - lis[1]))

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

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

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

print(cost)

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

Solution (Python):
alst = list(map(int, input().split()))
ans = 1000
for i in range(3):
  for j in range(3):
    for k in range(3):
      if i != j and j != k and i != k:
        ans = min(ans, 0 + abs(alst[j] - alst[i]) + abs(alst[k] - alst[j]))

print(ans)

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

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

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

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

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

print(abs(x-n))

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

for i in range(len(a)):
    for j in range(len(a)):
        if a[i]<a[j]:
            a[i], a[j]=a[j], a[i]

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

print(s)

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

result = 0

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

print(result)

Solution (Python):
a1,a2,a3 = map(int, input().split())
a_list = [a1,a2,a3]
a_list_sort = sorted(a_list)
ans_1 = a_list_sort[1]-a_list_sort[0]
ans_2 = a_list_sort[2]-a_list_sort[1]
print(ans_1+ans_2)

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

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

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

D = []
D.append(abs(A-B)+ abs(B-C))
D.append(abs(A-C)+ abs(B-C))
D.append(abs(A-B)+ abs(A-C))

print(min(D))

Solution (Python):

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

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

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

Solution (Python):
perm = [[0,1,2], [0,2,1], [1,0,2], [1,2,0], [2,0,1], [2,1,0]]
res = float('inf')
a = list(map(int,input().split()))
for p in perm:
  tmp = 0
  for i in range(2):
  	tmp += abs(a[p[i]]-a[p[i+1]])
  res = min(res, tmp)
print(res)

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


M = max(a, b, c)
m = min(a, b, c)
print(M - m)

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

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

a = sorted(a)

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

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

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

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

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

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

Solution (Python):
A1, A2, A3 = [int(elem) for elem in input().split(' ')]

abs1 = abs(A1 - A2)
abs2 = abs(A1 - A3)
abs3 = abs(A2 - A3)

sum_task = sum([abs1, abs2, abs3]) - max([abs1, abs2, abs3])
print(sum_task)

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

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

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

print(max(N)-min(N))

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

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

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

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

A.sort(reverse=True)
B = A.copy()
B.sort()

ans_a = 0
ans_b = 0
for i in range(1,3):
    ans_a +=abs(A[i]-A[i-1])
    ans_b += abs(B[i]-B[i-1])
    
print(min(ans_a,ans_b))

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(A):
    ans = 0
    A_ = [(a, i) for i, a in enumerate(A)]
    A_.sort()

    A.sort()
    p = A[0]
    for a in A:
        ans += abs(a-p)
        p = a
    return ans


def main():
    A = read_int_n()
    print(slv(A))


if __name__ == '__main__':
    main()

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

Solution (Python):
def main():
    A1,A2,A3 = map(int, input().split())
    a12 = abs(A1-A2)
    a23 = abs(A2-A3)
    a31 = abs(A3-A1)
    cost = [a12+a23, a23+a31, a31+a12]
    return min(cost)

if __name__ == "__main__":
    print(main())

Solution (Python):

def main():
    a = [int(i) for i in input().split()]

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

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

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

maxa = max(aas)
mina = min(aas)

print(maxa-mina)

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

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

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

print(sum)

Solution (Python):
import numpy as np

a = list(map(int,input().split()))
a = np.sort(a)
cos = 0
for k in range(2):
    cos += np.abs(a[k] - a[k+1])
print(cos)

Solution (Python):


if __name__ == '__main__':
    cost_list = list(map(int, input().split()))
    cost_list.sort()
    print(cost_list[2]-cost_list[0])

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

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

Solution (Python):
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import bisect

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

A = reads()

print(min(abs(p[1] - p[0]) + abs(p[1] - p[2]) for p in permutations(A)))

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

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

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

a = sorted(a)

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

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

Solution (Python):


a,b,c = map(int, input().split(" "))
ab = abs(a-b)
ac = abs(a-c)
bc = abs(b-c)
print(ab+ac+bc-max(ab,ac,bc))

Solution (Python):

A = list(map(int, input().split()))
A.sort()
cost = 0
prev = A[0]
for a in A:
    cost += abs(a - prev)
    prev = a

print(cost)

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

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

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

    cost = 0

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

    print(cost)


if __name__ == '__main__':
    main()

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

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

print(max(line)-min(line))

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

A = max(a,b,c)
C = min(a,b,c)
B = int((a*b*c)/(A*C))

print(A-B+B-C)

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

print(cnt)

Solution (Python):
from itertools import permutations

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

ans = float('inf')
for a, b, c in permutations(A, 3):
    x = abs(b - a) + abs(c -a)
    ans = min(ans, x)
print(ans)

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

a = abs(B-A) + abs(C-B)
b = abs(C-A) + abs(B-C)
c = abs(A-B) + abs(C-A)
d = abs(C-B) + abs(A-C)
e = abs(A-C) + abs(B-A)
f = abs(C-B) + abs(A-C)

print(min(a,b,c,d,e,f))

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

Solution (Python):
def inpl(): return map(int, input().split())
A = sorted(list(inpl()))
print(sum([A[i+1] - A[i] for i in range(len(A)-1)]))

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

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

A1 = A[-1]
A2 = A[1]
A3 = A[0]

print((A1 - A2) + (A2 - A3))

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

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

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

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

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

Solution (Python):
A = [int(_) for _ in input().split()]

d = [abs(A[0] - A[1]), abs(A[1] - A[2]), abs(A[2] - A[0])]

d.sort()

r = sum(d[:-1]) 
print(r)

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

Solution (Python):

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

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

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

B = [abs(A[0]-A[1]),abs(A[1]-A[2]),abs(A[2]-A[0])]

x = min([B[0]+B[1],B[1]+B[2],B[2]+B[0]])

print(x)

Solution (Python):
def getN():
    return int(input())
def getNM():
    return map(int, input().split())

a,b,c = getNM()
list = [a,b,c]

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

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

Solution (Python):
a = list(map(int, input().split()))
b1 = abs(a[0]-a[1])+abs(a[1]-a[2])
b2 = abs(a[0]-a[2])+abs(a[2]-a[1])
b3 = abs(a[1]-a[0])+abs(a[0]-a[2])
b4 = abs(a[1]-a[2])+abs(a[0]-a[2])
b5 = abs(a[2]-a[0])+abs(a[0]-a[1])
b6 = abs(a[2]-a[1])+abs(a[0]-a[1])
ans = min(b1, b2, b3, b4, b5, b6)
print(ans)

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

b=abs(A[0]-A[1])+abs(A[0]-A[2])

c=abs(A[0]-A[1])+abs(A[1]-A[2])
d=abs(A[0]-A[2])+abs(A[1]-A[2])

print(min(b,c,d))

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

Solution (Python):
x = map(int, raw_input().split())
print max(x) - min(x)

Solution (Python):

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

ans = A[2] - A[0]  

print(ans)

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

a.sort()

value = (a[1]-a[0]) + (a[2]-a[1])

print(value)

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

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

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

Solution (Python):
from math import *
a, b, c = map(int, input().split())
q1 = abs(a-b)
q2 = abs(b-c)
q3 = abs(c-a)

print(min(q1+q2,q2+q3,q3+q1))

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

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

ans = float('inf')
for x, y, z in permutations([0, 1, 2]):
    ans = min(ans, abs(A[x]-A[y]) + abs(A[y]-A[z]))
print(ans)

Solution (Python):
from numpy import *
from scipy import *
from sys import *

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

Solution (Python):
if __name__ == "__main__":
    xs = sorted([int(s) for s in input().split()])
    print(sum(a - b for (a, b) in zip(xs[1:], xs[:len(xs) - 1])))

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

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

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

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

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

A.sort(reverse=True)
B = A.copy()
B.sort()

ans_a = 0
ans_b = 0
for i in range(1,3):
    ans_a +=abs(A[i]-A[i-1])
    ans_b += abs(B[i]-B[i-1])
    
print(min(ans_a,ans_b))

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

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

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

Solution (Python):
one,two,three = map(int,input().split())
ma = max([one,two,three])
mi = min([one,two,three])
print(ma-mi)

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

print(a+b+c - max([a,b,c]))

Solution (Python):
a1, a2, a3 = map(int, input().split())
c1 = abs(a1 - a2) + abs(a2 - a3)
c2 = abs(a1 - a3) + abs(a3 - a2)
c3 = abs(a2 - a1) + abs(a1 - a3)
c4 = abs(a2 - a3) + abs(a3 - a1)
c5 = abs(a3 - a1) + abs(a1 - a2)
c6 = abs(a3 - a2) + abs(a2 - a1)
print(min([c1, c2, c3, c4, c5, c6]))

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

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

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

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

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

Solution (Python):


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

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

Solution (Python):
T = [int(i) for i in input().split()]
a, b, c = sorted(T)
ans = abs(b - a) + abs(c - b)
print(ans)

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

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

Solution (Python):
import sys
As = list(map(int, sys.stdin.readline().split()))
As.sort()
print(sum(map(lambda a_b: a_b[1] - a_b[0], zip(As, As[1:]))))

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

Solution (Python):


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

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

Solution (Python):

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

for i in range(len(a)):
    if i == 0:
        pass

    else:
        ans += (a[i] - a[i-1])

print(ans)

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

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

n.sort()


sum = 0
for i in range(len(n)-1):
    sum += abs(n[i]-n[i+1])

print(sum)

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

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

Solution (Python):

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

A.sort()

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

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

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

print(max(li)-min(li))

Solution (Python):




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

ans=S[2]-S[0]

print(ans)

Solution (Python):
l = sorted([int(c) for c in input().split()])

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

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

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

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

ans = 0

A.sort()

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

print(ans)

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

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

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

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

Solution (Python):
import sys

A = sorted(map(int, sys.stdin.readline().split()))

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

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

Solution (Python):
import itertools
A=[int(i) for i in input().split()]
S=list(itertools.permutations(A,3))
ans=30000
for sg in S:
    tmp=0
    tmp+=abs(sg[1]-sg[0])
    tmp+=abs(sg[2]-sg[1])
    if tmp<ans:
        ans=tmp
print(ans)

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

tmp = array[0]
ans = 0
for i in array[1:]:
    ans += i-tmp
    tmp = i
print(ans)

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

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

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

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

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

print(ans)

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

Solution (Python):



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


if __name__ == '__main__':
    main()

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

d=abs(a-b)
e=abs(a-c)
f=abs(b-c)
print(d+e+f-max(d,e,f))

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

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

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

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

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

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

Solution (Python):
from itertools import permutations

A = map(int, raw_input().split())
ans = float('inf')
for p in permutations([0, 1, 2]):
    tmp = abs(A[p[0]] - A[p[1]]) + abs(A[p[1]] - A[p[2]])
    ans = min(ans, tmp)
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()
a.reverse()
print(a[0]-a[1]+a[1]-a[2])

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

max=max([a,b,c])
min=min([a,b,c])

print(max-min)

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=[int(i) for i in input().split()]
print(max(A)-min(A))

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

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