Solve problem 72 using Java.
Work around OS X's limited sed edit command.