Solved 3rd task from Section 1.1