def extract_last_solution(inFile,outFile):
  """
  Extracts from a file the last solution saving it in another file.
  Rerturns true if a solutions is found.
  """
  solution = False
  sol = ""
  
  for line in reversed(open(inFile,'r').readlines()):
    if not solution:
      if line.startswith("----------"):
        solution = True
    else:
      if line.startswith("----------"):
        break
      else:
        sol = line + sol
  
  with open(outFile, 'w') as f:
    f.write(sol)
  return solution