Rewrite TSP files