Fixed read/write in Solution.java