Solving linear systems of equations over integers with Grobner bases