How to define a sequence input fields?

Our algorithm looks at the position of each element in the current group and goes from left to right, top to bottom. So if elements are well aligned, it should just work. And grouping elements in a group is a good way to make sure elements follow each others.