def solve_quad_mod (a, b, c, n):
    """ Solve a quadratic equation modulo n.

    Find all solutions to the quadratic equation  
        a*x^2 + b*x + c  = 0 mod n
    for integer n.  Here a, b, c are integers.
    """

    solutions = []
    for x in range (n):
        poly_val = (a*x*x + b*x + c) % n
        if poly_val == 0:
            solutions.append(x)

    return   solutions