In the secret vault of the Jedi, protocol R2-A2 stores a message that initially consists of a single letter A. Every second, the droid–archivist launches a self-encryption program that applies the following transformations to each byte:
A C;
B BCA;
C B.
After seconds, the Jedi Council seeks to determine:
the number of bytes in the encrypted message (modulo 10^{9}+7);
the byte at position (-based indexing).
In a single line, two integers and are given (0 \le n \le 10^6, 1 \le k \le \min(S,10^9)), where is the length of the message after seconds.
In a single line, output two values separated by a space:
the number of bytes after seconds of encryption (modulo 10^{9}+7);
the character (A, B, or C) at position .
Example 1
Example 2
In the first example, n=4, k=4. The per-second transformations of the string:
Therefore, |S_4|=5, and the character at position 4 is B.