solver for japanese sum riddle in java