Thank you very much folks, you have enlightened the points I could not figure out.
Both solutions (HoAoH by robotics and japhy; HoHoH by liverpole) worked.
HoHoH solution has the drawback that the interpreter generates an initialization error during initialization of indices.