Find the sum of the numbers larger than 670 and the sum of the numbers smaller than 500 among three digits that can be made using 4, 6, and 7 only once.  
[OP_LIST_SOL] 4 6 7 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 670 [OP_LIST_MORE] [OP_LIST_SUM] [OP_LIST_POP] 500 [OP_LIST_LESS] [OP_LIST_SUM] [OP_SUB] [OP_ABS]
var_a = 4
var_b = 6
var_c = 7
list_a= []
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_d = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
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_e = 670
list_c = []
for i in list_b:
    if i > var_e:
        list_c.append(i)
list_c = [float(i) for i in list_c]
var_f = sum(list_c)
var_g = 500
list_d = []
for i in list_b:
    if i < var_g:
        list_d.append(i)
list_d = [float(i) for i in list_d]
var_h = sum(list_d)
var_i = var_f - var_h
var_j = abs(var_i)
print(int(var_j))