public int[] solvingLinearComparisons(int a, int b, int n) {
        if (a < 0) a = a + n;
        if (b < 0) b = b + n;
        int d = gcd(a, n);
        int[] result = new int[d];
        if (d == 1) {
            result[0] = (getInverseElement(a, n) * b) % n;
            return result;
        } else {
            if (b % d == 0) {
                int a1 = a / d;
                int b1 = b / d;
                int n1 = n / d;
                for (int i = 0; i < result.length; i++) {
                    result[i] = (((getInverseElement(a1, n1) * b1)) + i * n1) % n;
                }
                return result;
            } else {
                return null;
            }
        }
    }