solve problem 37. It takes about 0.5sec.