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

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

print(ans)

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

Solution (Python):
lst = map(int, raw_input().split())


print(max(lst)-min(lst))

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

print(c)

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

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

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

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

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

Solution (Python):
str = raw_input()
a = map(int, str.split())

print max(a) - min(a)

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

Solution (Python):
A1,A2,A3 = map(int,input().split())
cost = [abs(A1 - A2), abs(A2 - A3), abs(A3 - A1)]
cost.sort(reverse = True)
cost[0] = 0
print(sum(cost))

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

Solution (Python):
A1,A2,A3 = map(int, input().split())
A = [A1, A2, A3]
A.sort(reverse=True)
for i in range(3):
    if i == 0:
        sum=0
    else:
        sum = sum+abs(A[i] - A[i-1])
print(sum)

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

A.sort()
A.reverse()

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

Solution (Python):
l = [int(v) for v in input().split()]
l.sort(reverse=True)
cost = l[0] - l[1] + l[1] - l[2]
print(cost)

Solution (Python):
def minimum(a1, a2, a3):
    a = sorted([a1, a2, a3])
    return abs(a[0] - a[1]) + abs(a[1] - a[2])

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

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

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

tasks.sort()

j = min(tasks)
tasks.remove(j)

for i in tasks:
    cost += (i - j)
    j = i

print(cost)

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

d = abs(a-b)
e = abs(b-c)
f = abs(c-a)

m =max(d,e,f)

print(d+e+f-m)

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

Solution (Python):
*a,=sorted(map(int,input().split()))
a1=abs(a[1]-a[0])+abs(a[2]-a[1])
a2=abs(a[2]-a[0])+abs(a[1]-a[2])
a3=abs(a[0]-a[1])+abs(a[2]-a[0])
a4=abs(a[2]-a[1])+abs(a[0]-a[2])
a5=abs(a[0]-a[2])+abs(a[1]-a[0])
a6=abs(a[1]-a[2])+abs(a[0]-a[1])
print(min([a1,a2,a3,a4,a5,a6]))

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

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

list = []
list.append(A1)
list.append(A2)
list.append(A3)

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

print(ans)

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

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

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

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

a = [A1, A2, A3]
a.sort()

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

Solution (Python):


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

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

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

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

Solution (Python):

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

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

Solution (Python):

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

Solution (Python):

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

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

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

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

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

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

W = min(abs(a-b)+abs(a-c), abs(b-a)+abs(b-c), abs(c-a)+abs(c-b))

print(W)

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

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

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

a = []
a.append(a1)
a.append(a2)
a.append(a3)

a.sort()

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

print(ans)

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

Solution (Python):

"""
Created on Sun Sep 23 15:58:40 2018

@author: masato
"""
a = list(map(int, input().split()))
b = sorted(a)

cnt = 0
c = 0
for i in range(len(b)-1):
    c = abs(b[i]- b[i + 1])
    cnt += c
print(cnt)

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

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

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

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

ans = float('inf')
for i in range(3):
    for j in range(3):
        if j == i:
            continue
        for k in range(3):
            if k == i or k == j:
                continue
            cost = abs(l[j] - l[i]) + abs(l[k] - l[j])
            ans = min(ans, cost)
print(ans)

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

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

Solution (Python):

"""
A - Task Scheduling Problem
https://beta.atcoder.jp/contests/abc103/tasks/abc103_a

"""
import sys
from sys import stdin
input = stdin.readline


def solve(a1, a2, a3):
    ans = float('inf')
    ans = min(ans, abs(a2-a1) + abs(a3-a2))
    ans = min(ans, abs(a3-a1) + abs(a2-a3))
    ans = min(ans, abs(a1-a2) + abs(a3-a1))
    ans = min(ans, abs(a3-a2) + abs(a1-a3))
    ans = min(ans, abs(a2-a3) + abs(a1-a2))
    ans = min(ans, abs(a1-a3) + abs(a2-a1))
    return ans


def main(args):
    a1, a2, a3 = map(int, input().split())
    ans = solve(a1, a2, a3)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Solution (Python):
t1,t2,t3 = map(int,input().split())
t = [t1,t2,t3]
print(max(t) - min(t))

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

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

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

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

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

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

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

print(a)

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

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

Solution (Python):
arr = map(int,raw_input().split())
arr.sort()
cost = arr[1]-arr[0] + arr[2]-arr[1]
print cost

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

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

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

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

Solution (Python):
a = list(map(int,input().split()))
Min = min(a)
Max = max(a)
Mid = sum(a) - Max - Min
 
ans = Mid-Min + Max-Mid
print(ans)

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

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

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

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

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

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

Solution (Python):
l = map(int, raw_input().split())
ls = [abs(l[0]-l[1]), abs(l[1]-l[2]), abs(l[2]-l[0])]
print sum(ls) - max(ls)

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

Solution (Python):
import math

a,b,c = map(int,input().split())
lst = []
lst.append(a)
lst.append(b)
lst.append(c)
lst.sort()

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

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

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

Solution (Python):
import itertools

src = map(int, input().split())
ans = 1000
for p_i in list(itertools.permutations(src)):
    candidate = abs(p_i[1]-p_i[0]) + abs(p_i[2]-p_i[1])
    ans = min(ans, candidate)
print(ans)

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

Solution (Python):


a = map(int,raw_input().split())

a.sort()

print a[2] - a[0]

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

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

ans = 0

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

print(ans)

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

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

Solution (Python):

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

Solution (Python):
a = map(int, raw_input().split())
max = -1
min = 101
for i in range(0, 3):
	if max < a[i]: max = a[i]
	if a[i] < min: min = a[i]
print max - min

Solution (Python):
def solution(a):
    return max(a) - min(a)
 
def main():
    a = [int(i) for i in raw_input().strip().split()]
    print solution(a)
 
if __name__ == '__main__':
    main()

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

total = 0
total = max(A) - min(A)
print(total)

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

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

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

Solution (Python):

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

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

Solution (Python):
from itertools import permutations

a1, a2, a3 = map(int, input().split())
ans = 1e9
for a in permutations([a1, a2, a3]):
    tmp = abs(a[0] - a[1]) + abs(a[1] - a[2])
    ans = min(ans, tmp)
print(ans)

Solution (Python):
import numpy as np

l = [int(i) for i in input().split()] 
l_sort = np.sort(l)
l_diff = np.diff(l_sort)

print(np.sum(l_diff))

Solution (Python):
l = [int(i) for i in input().split()] 
ans = 0

for j in range(len(l) - 1):
	for i in range(len(l) - 1):
		if l[i+1] < l[i]:
			tmp = l[i+1]
			l[i+1] = l[i]
			l[i] = tmp
        
for i in range(len(l) - 1):
	ans += l[i+1] - l[i]
    
print(ans)

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

Solution (Python):


import sys, re

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

    a.sort()

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

    print(ans)

    return 0

if __name__ == '__main__':
    sys.exit(main())

Solution (Python):
import heapq
A1,A2,A3=map(int,input().split())
a = [A1, A2, A3]
heapq.heapify(a)
min=a[0]
heapq.heappop(a)
M=a[0]
heapq.heappop(a)
max=a[0]
print(max-min)

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

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

Solution (Python):
(a1,a2,a3)=[(int)(e) for e in (input().split(' '))]
print(max(a1,a2,a3)-min(a1,a2,a3))

Solution (Python):
l = sorted([int(e) for e in input().split()])
 
result = sum(l[i] - l[i-1] for i in range(1, len(l)))
print(result)

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

result = sum(l[i] - l[i-1] for i in range(1, len(l)))
print(result)

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

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

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

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

diff1 = abs(a1 - a2)
diff2 = abs(a2 - a3)
diff3 = abs(a3 - a1)

diffs = [diff1, diff2, diff3]

diffs = sorted(diffs)

print(sum(diffs[:2]))

Solution (Python):
N, K, L = input().split()
S=int(N)-int(K)
S=abs(S)
I=int(L)-int(K)
I=abs(I)
M=int(N)-int(L)
M=abs(M)
list=(S, I ,M)
print(S+I+M-max(list))

Solution (Python):
[A1,A2,A3]=map(int,input().split())
tasks=[A1,A2,A3]
costs=[]
def cost(start):
    for i in range(3):
        if i!=start:
            cost_1st=abs(tasks[i]-tasks[start])
            for l in range(3):
                if l != i and l != start:
                    total_cost=cost_1st+abs(tasks[i]-tasks[l])
                    costs.append(total_cost)
                else:
                    continue
        else:
            continue
for i in range(3):
    cost(i)

ans=min(costs)

print(ans)

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

Solution (Python):

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

ans = 0
A = [A1,A2,A3]

A.sort()

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

    
print(ans)

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

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

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

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-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 pf(s): return print(s, flush=True)


def main():
    a = sorted(LI())
    return a[-1] - a[0]


print(main())

Solution (Python):
A = list(map(int, 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):
A = list(map(int, input().split()))
sum = 0

a1 = max(A)
A.remove(a1)
a2 = max(A)
A.remove(a2)
a3 = A.pop()

sum += (abs(a2 - a1) + abs(a2 - a3))
print(sum)

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

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

costs = []
costs.append(abs(A1-A2) + abs(A2-A3))
costs.append(abs(A1-A3) + abs(A3-A2))
costs.append(abs(A2-A1) + abs(A1-A3))
costs.append(abs(A2-A3) + abs(A3-A1))
costs.append(abs(A3-A1) + abs(A1-A2))
costs.append(abs(A3-A2) + abs(A2-A1))

print(min(costs))

Solution (Python):
a,b,c=map(int,input().split())
if(a==b and a==c):
    print("0")
    exit()
elif(a==c or a==b or b==c):
    if(a==b):
        print(abs(b-c))
    if(a==c):
        print(abs(b-a))
    if(b==c):
        print(abs(a-b))
else:
    count=0
    l=[a,b,c]
    num=min(l)
    l.remove(min(l))
    num2=min(l)
    count+=abs(num2-num)
    l.remove(min(l))
    count+=abs(num2-l[0])
    print(count)

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

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

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

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

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

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

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

n.sort()

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

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

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

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

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

Solution (Python):
from statistics import median

task=[int(i) for i in input().split()]
    
b=median(task)
sum=0

for i in range(3):
    sum+=abs(b-task[i])
    
print(sum)

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()
ans = 0

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

print(ans)

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

Solution (Python):
l= input()
s=l.split()

s.sort(key=int)

a1 = int(s[0])
a3 = int(s[2])

c = a3 - a1

print(c)

Solution (Python):
l= input()
s=l.split()

s.sort(key=int)

a1 = int(s[0])
a2 = int(s[1])
a3 = int(s[2])

c = a3 - a1

print(c)

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

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

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

Solution (Python):


def getRes(raw_input):
    return max(raw_input) - min(raw_input)

if __name__ == "__main__":
    raw_input = [int(x) for x in input().split(" ")]
    print(getRes(raw_input))

Solution (Python):


def getMatrix(raw_input):
    mlist = []
    for i in range(0, len(raw_input)-1):
        for j in range(i+1, len(raw_input)):
            mlist.append(abs(raw_input[i] - raw_input[j]))
            
    return mlist

def getProduct(mlist):
    plist = []
    for i in range(0, len(mlist)-1):
        for j in range(i+1, len(mlist)):
            plist.append(mlist[i]+mlist[j])
    
    return plist

if __name__ == "__main__":
    raw_input = [int(x) for x in input().split(" ")]
    print(min(getProduct(getMatrix(raw_input))))

Solution (Python):
import sys 
import math


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


a.sort()

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

Solution (Python):
import itertools

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

anss = []
for ps in itertools.permutations(xs, len(xs)):
  ps = list(ps)
  head = ps[0]
  ps2 = ps.copy()
  ps2.insert(0, 0)
  s = [abs(a-b) for a, b in list(zip(ps, ps2))]
  
  anss.append(sum(s)-head)
print(min(anss))

Solution (Python):
a1,a2,a3= map(int,input().split())
a = [a1,a2,a3]
i=0
sum = 0
amin = min(a)
del(a[a.index(amin)])
sum += min(a)-amin
amin = min(a)
del(a[a.index(amin)])
sum += min(a)-amin
print(sum)

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

Solution (Python):


from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


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


if __name__ == '__main__':
    main()

Solution (Python):
from sys import stderr
from functools import reduce
from operator import add
def f(): return [int(i) for i in input().split()]
def debug(*x, sep=" ", end="\n"):
    for item in x:
        stderr.write(repr(item))
        stderr.write(sep)
    stderr.write(end)

a1,a2,a3 = f()

a = abs(a1-a2)
b = abs(a2-a3)
c = abs(a3-a1)
print(min(a+b,b+c,c+a))

Solution (Python):


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

aa = [a,b,c]
aa = sorted(aa)

for i in range(len(aa)):
    if i == 0:
        p=0
    else:
        p=aa[i]-aa[i-1]+p
        
print(p)

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

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

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

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

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

m = min(abs(a-b)+abs(b-c),abs(a-c)+abs(c-b),abs(b-a)+abs(a-c))
print(m)

Solution (Python):
a=list(map(int,input().split()))
out=abs(a[1]-a[0])+abs(a[2]-a[1])
for i in range(3):
    if i ==0:
        b=a[1]
        c=a[2]
    elif i==1:
        b=a[0]
        c=a[2]
    else:
        b=a[0]
        c=a[1]
    if ((abs(b-a[i])+abs(c-b))<out):
        out=abs(b-a[i])+abs(c-b)
    if ((abs(c-a[i])+abs(b-c))<out):
        out=abs(c-a[i])+abs(b-c)
print(out)

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

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

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

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

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

Solution (Python):

n = input()
list = n.split(" ")
num = [int(x) for x in list ]

print(max(num)-min(num))

Solution (Python):
S=raw_input()
L=S.split()
a=int(L[0])
b=int(L[1])
c=int(L[2])
m=min(a,min(b,c))
M=max(a,max(b,c))

ans=M-m
print ans

Solution (Python):


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

Solution (Python):



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

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

Solution (Python):
def main():
    task_str = input().split()
    task_list = []
    task_list = [int(s, 10) for s in task_str]
    task_list.sort()
    result = task_list[2] - task_list[0]
    print(result)

if __name__=='__main__':
    main()

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

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

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

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

Solution (Python):
l = input().split(" ")
for i in range(3):
    l[i]=int(l[i])
l = sorted(l)
c = l[2]-l[0]
print(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):
a = list(map(int, input().split()))
print(max(a) - min(a))

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

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

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

Solution (Python):
a1,  a2,  a3 = map(int, input().split())
ans = 0
kanou1 = abs(a1-a2)+abs(a1-a3)
kanou2 = abs(a2-a1)+abs(a2-a3)
kanou3 = abs(a3-a1)+abs(a3-a2)
if kanou1 <= kanou2:
    ans = kanou1
else:
    ans = kanou2
    
if ans <= kanou3:
    print(ans)
else:
    ans = kanou3
    print(ans)

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

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

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

Solution (Python):
a1, a2, a3 = map(int, input().split())
x = abs(a1 - a2) + abs(a2 - a3)
y = abs(a1 - a3) + abs(a1 - a2)
z = abs(a2 - a3) + abs(a1 - a3)
print(min(x, y, z))

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

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

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

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

    
    
    
    ans = max([a1,a2,a3]) - min([a1, a2, a3])
    print(ans)


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):

import itertools
if __name__ == "__main__":
    a  = list(map(int, input().split()))
    ans = float('inf')
    factor = list(itertools.permutations(a))
    for tuples in factor:
        cost = 0
        for tmp in range(1,3):
            cost += abs(tuples[tmp]-tuples[tmp-1])
        ans = min(ans, cost)
    print(ans)

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

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

lt = sorted([abs(A[0]-A[1]), abs(A[0]-A[2]), abs(A[1]-A[2])])
cost = lt[0]+lt[1]
print(cost)

Solution (Python):
tasks = input()

tasks = [int(t) for t in tasks.split()]


cost0 = abs(tasks[1] - tasks[0]) + abs(tasks[2] - tasks[1])


cost1 = abs(tasks[2] - tasks[0]) + abs(tasks[2] - tasks[1])


cost2 = abs(tasks[1] - tasks[0]) + abs(tasks[2] - tasks[0])


cost3 = abs(tasks[1] - tasks[2]) + abs(tasks[2] - tasks[0])


cost4 = abs(tasks[2] - tasks[0]) + abs(tasks[0] - tasks[1])


cost5 = abs(tasks[2] - tasks[1]) + abs(tasks[0] - tasks[1])

min_cost = min([cost0, cost1, cost2, cost3, cost4, cost5])

print(min_cost)

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

Solution (Python):
ip = input()
lis = ip.split(" ")
for i in range(len(lis)):
	lis[i] = int(lis[i])
lis = sorted(lis)
ans = 1e9
su = 0
for i in range(0,len(lis)-1):
	su+=abs(lis[i+1]-lis[i])
ans = min(ans,su)

print(ans)

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

A = sorted(A)

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

print(res)

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

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

a.sort(reverse=True)

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

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

Solution (Python):
def main():
    cost_list = input().split()
    for i in range(len(cost_list)):
        cost_list[i] = int(cost_list[i])
    cost_list.sort()
    counter = 0
    for i in range(len(cost_list) - 1):
        counter += cost_list[i+1] - cost_list[i]
    print(counter)

main()

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

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

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

a.sort(reverse=True)

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

Solution (Python):


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

Solution (Python):
from itertools import permutations
a=[int(x) for x in input().split()]
print(min([abs(a[i1]-a[i0])+abs(a[i2]-a[i1]) for i0,i1,i2 in permutations([0,1,2])]))

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())
ans=[]
ans.append(abs(a-b))
ans.append(abs(b-c))
ans.append(abs(a-c))
ans.sort()
print(ans[0]+ans[1])

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

print(ans)

Solution (Python):
A = list(map(int, input().split()))
first = max(A)
A.remove(max(A))
cost1 = 0
cost1 += abs(first - A[0])
cost1 += abs(A[0] - A[1])
cost2 = 0
cost2 += abs(first - A[1])
cost2 += abs(A[0] - A[1])
print(min(cost1, cost2))

Solution (Python):

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

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