Twelve-Bar Linkage for Stretch and Turn

Input: one of the bars pivoted on the grey base.
Length of the grey base bar and the yellow end bar: a
Length of blue bar: a
Length of green bars: 0.4a + 0.6a
Length of orange bars: 0.4a
Output: the yellow end bar that moves out and gets horizontal position.
The gravity tends to keep the mechanism at stretching position.