I have reffered to the mechanism shown in the text which is:
[![Mechanism as shown in textbook](https://i.stack.imgur.com/PX84G.png)](https://i.stack.imgur.com/PX84G.png)

But I am not able to figure out how this took place:
[![Actual question.](https://i.stack.imgur.com/7TLQp.png)](https://i.stack.imgur.com/7TLQp.png)

Please help me with it. Though it is a homework question but I have tried my best to solve it and so I request you not to report this as homework question.
Thank you.