Find the second smallest natural number that is greater than 500, and that has 3 as a remainder when divided by 7.
1 9999 1 [OP_LIST_ARANGE] 500 [OP_LIST_MORE] 7 3 [OP_LIST_DIVIDE_AND_REMAIN] 2 [OP_LIST_MIN]
var_a = 1
var_b = 9999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 500
list_b = []
for i in list_a:
    if i > var_d:
        list_b.append(i)
var_e = 7
var_f = 3
list_c = [] 
var_e = int(var_e)
var_f = int(var_f)
if var_f < 0:
    var_f = var_f + var_e
for i in list_b:
    i = int(i)
    if i%var_e == var_f:
        list_c.append(i)
var_g = 2
list_d=list_c.copy()
list_d.sort()
var_h = list_d[var_g-1]
print(int(var_h))