second task

Second problem solution