Create problem40.java