GCD of very large numbers

179 Views Asked by At

There are $3$ numbers $a$, $b$ and $n$ and I want to calculate gcd of $(a^n + b^n , |a - b| ) \bmod M$ ,where $1\le a, b,n \le 10^{12}$ and $M = 10^9 + 7$.