For prove it just use some maths

See on one iteration of "for":

let be x and y on start:x1 and y1.

then after each change it'll be for x1 x2...x3; for y1 y2...y3;

so you have to find out x3 and y3 through x and y on start(x1 and y1);

Something like that x3=y1.

Good luck and sorry if my English is not enough good for explaining it)