Zibon just started his courses in Computer science. After having some lectures on programming courses he fell in love with strings. He started to play with strings and experiments on them. One day he started a string of arbitrary (of course positive) length consisting of only {a, b}. He considered it as 1st string and generated subsequent strings from it by replacing all the b's with ab and all the a's with b. For example, if he ith string is abab, (i+1)th string will be b(ab)b(ab) = babbab. He found that the Nth string has length X and Mth string has length Y. He wondered what will be length of the Kth string. Can you help him?
Input
Input starts with an integer T (≤ 200), denoting the number of test cases.
Each case begins with five integers N, X, M, Y, K. (0 < N, M, X, Y, K < 109 and N ≠ M).
Output
For each case print one line containing the case number and L which is the desired length modulo 1000000007 (109 + 7) or the string Impossible
if it's not possible.
Sample
Sample Input | Sample Output |
---|---|
2 3 16 5 42 6 5 1 6 10 9 | Case 1: 68 Case 2: Impossible |