Solve CatsOnTheLineDiv2