Solution to test task