Frank likes square numbers. That is numbers, which are the product of some integer with itself. Also Frank likes quadratic polynomials. He even has his favorite one: p(x)=a⋅x2+b⋅x+c.
This morning Frank evaluated his favorite quadratic polynomial for n consecutive integer arguments starting from 0 and multiplied all the numbers he got.
If the resulting product is a square, his day is just perfect, but that might be not the case. So he asks you to find the largest square number which is a divisor of the resulting product.
The only line of the input contains 4 integers a,b,c,n (1≤a,b,c,n≤600,000).
Find the largest square divisor of ∏_i=0n−1p(i). As this number could be very large, output a single integer --- its remainder modulo 109+7.
In the first example, the product is equal to 1⋅3⋅7⋅13⋅21⋅31⋅43⋅57⋅73⋅91=2893684641939=38826291⋅2732.