Solve 588_2 500 points program.