Last version of the heuristic.

Last version of the heuristic. Now write in output.txt the solution.
Still need a last test to see if the solution is ok.