in reply to Pairing the pairs
...all this row stuff..hmm...your rows "P" just end up being pairs of numbers...and your problem looks like a non-problem, i.e. i can only see one (reasonable) solution for any input values = your pairs of numbers picked out...and it doesn't matter which pairs you pick. Elucidate some more, if i'm not getting the correct picture.