Go back to the room with octopus and go one level down. Push the red button on the right - the passage will open. Click the bowl - Tommy will throw the bird into it. Switch to Beaky and click the bowl. Beak-Beak will swallow the bird.
By clicking mouse cursor upper and upper show the route which Beaky should fly.
When Beak-Beak will fly to the crossroad, turn right. Click the next lever (the dog will swallow it). Turn left and up, then right.
On the bottom of this tunnel is red button, push it and go back (left, then down). As Tommy pick up the lever.
Leave the cavern - put the lever into the grip on the left side of the door. Open the door and go outside. Put the second lever into the machine.