Remove the broken lamp and put the LIGHTING ELEMENT in the lantern (V); take the LANTERN.
Give the LANTERN to the other statue (W).
Play the mini-game.
Swap adjacent segments to create one continuous blue line (X).
Take the WINDING KEY (Y).
Go into the Guard House.
Give the WOODEN HAND to the guard and wind him up with the WINDING KEY (Z).
Take the MECHANISM HANDLE (A).
Walk down. Inspect the gate.