Update problem31.java