Seven out of Eight correct - I'll give you a B+ for neat work. Set #1 when #8 is depressed. If you can't be bothered with the maths, just count in from each end - if the valve two in from the left is depressed, set the valve two in from the right and so on.