Tried to solve 3rd task in Section 1.4