Phibonacci

No attempts yetTime limit1sMemory limit256 MB

Problem

The Fibonacci numbers are defined by the recurrence below.

Fn={0n=01n=1Fn1+Fn2n>1F_n = \begin{cases} 0 & n = 0 \\ 1 & n = 1 \\ F_{n-1} + F_{n-2} & n > 1 \end{cases}

The Fibonacci numbers are closely tied to the golden ratio φ=5+12\varphi = \frac{\sqrt{5}+1}{2}, one of the two roots of x2=x+1x^2 = x + 1. One example of that tie is the closed form Fn=φn(1φ)n5F_n = \frac{\varphi^n - (1 - \varphi)^n}{\sqrt{5}}. Now use φ\varphi to define the Phibonacci numbers by the recurrence below.

Pn={1n=0φn=1Pn1+Pn2n>1P_n = \begin{cases} 1 & n = 0 \\ \varphi & n = 1 \\ P_{n-1} + P_{n-2} & n > 1 \end{cases}

If you set F1=1F_{-1} = 1, then Pn=Fnφ+Fn1P_n = F_n \varphi + F_{n-1} holds for every n0n \ge 0. The question here is whether (Pn)k(P_n)^k can be written as Aφk+BA \varphi^k + B for two integers AA and BB. If it can, print AA and BB. If it cannot, print -1.

Input

The first line contains two integers nn and kk, separated by a space.

The bounds are 0n10120 \le n \le 10^{12} and 1k10121 \le k \le 10^{12}.

Output

On the first line, print the two integers AA and BB with (Pn)k=Aφk+B(P_n)^k = A \varphi^k + B, each taken modulo 1,000,000,007 and separated by a space. If no such pair of integers exists, print -1.

Hint

For n=3n = 3 and k=2k = 2, (P3)2=(2φ+1)2=4φ2+4φ+1=8φ23(P_3)^2 = (2\varphi + 1)^2 = 4\varphi^2 + 4\varphi + 1 = 8\varphi^2 - 3. The remainder of 3-3 modulo 1,000,000,007 is 1,000,000,004.