solved problem 24