You want to create a four-digit number using all 4, 5, 8, and 9. When you made the third smallest number, two numbers in the middle were swapped, resulting in 4958. Find the sum of the number created and the number changed.
[OP_LIST_SOL] 4 5 8 9 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 3 [OP_LIST_MIN] 4958 [OP_ADD]
var_a = 4
var_b = 5
var_c = 8
var_d = 9
list_a= []
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_e))
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_f = 3
list_c=list_b.copy()
list_c.sort()
var_g = list_c[var_f-1]
var_h = 4958
var_i = var_g + var_h
print(int(var_i))