Find the difference between the largest number and the third smallest number that can be made by changing the order of the digits in each place of 168.
168 [OP_NUM2LIST] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 3 [OP_LIST_MIN] [OP_SUB]
var_a = 168
list_a = []
var_a = int(var_a)
while var_a//10 > 0:
    list_a.append(var_a%10)
    var_a = var_a//10
list_a.append(var_a%10)
list_a = list_a[::-1]
var_b = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_b))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_c = 1
list_c=list_b.copy()
list_c.sort()
var_d = list_c[-var_c]
var_e = 3
list_d=list_b.copy()
list_d.sort()
var_f = list_d[var_e-1]
var_g = var_d - var_f
print(int(var_g))