I make second try for solving problem 31