Python. RSA common modulus attack problem
I have solved this problem. @fgrieu  was right! Thanks for him and other!

Calculating modular inverse

if a &lt; 0:
    _, eM1, __ = gmpy2.gcdext(eM1, N)
elif b &lt; 0:
    _, eM2, __ = gmpy2.gcdext(eM2, N)


Calculating source message M

M1 = pow(eM1, abs(a), N) #I just realized, that always i need to use modulus pow(a,b,n)
M2 = pow(eM2, abs(b), N) #In this way all calculations are really fast!
M = (M1 * M2) % N # And final multiplication uses modulus same as previous expression