def invert(self, a):
    assert (not ((a.val % self.p) == 0))
    return FieldElem(gmpy.invert(a.val, self.p), self)
def invert(self, a):
    assert (not ((a.val % self.p) == 0))
    return FieldElem(gmpy.invert(a.val, self.p), self)