The action of the (epicyclic) gears appears complex at first sight, but is easier to understand when reversing the motion of the engine e.g. having the
crankshaft rotating instead of the engine for visibility purposes.
The timing is based on the inner inlet- and exhaust gears (both 16 teeth) rotating within the outer gears (18 teeth), around excentric cams which are fixed to the crankshaft. The gear ratio of 18/16 makes the inner gears rotate 1 1/8 times during every engine revolution (in this case one crankshaft revolution), thus providing the correct timing for a 4 stroke 9 cylinder engine. The 4 stroke events sequence is 1, 3, 5, 7, 0, 2, 4, 6, 8.