Solution to task6