def find_quad_residue(m):
    """Return a list of all quadratic residues modulo m"""
    L = []
    for i in range(m):
        q = i**2 % m
        if q not in L:
            L.append(q)
    L.sort()
    return L