You will have to try out various combinations to see which is the correct one.
you get good enough at it that by looking at the grid you can place the ribbons correctly in the right order at first attempt.