How could I change this code

a = 10
b = a
b = 5

to result in a=5 as well, in safe environment, if possible?

Thanks,
John