write solved to file