problem 40 done