31 problem solution