Solves linear diophantine equations