Update Solution.java

Prints stack to file, what I meant to do the last time.