Solution to the third challenge