Variable in loop

Have you tried nesting the two loops?

Giacomo