Chiaki finds the following interesting stone game: two players start with two non-empty piles of stones. In each turn, the player can choose a pile with an even number of stones and move half of the stones of this pile to the other pile. The game ends if a player cannot move, or if we reach a previously reached position. In the first case, the player who cannot move loses. In the second case, the game is declared a draw.
Given two positive integers n and m, Chiaki would like to know the number of pairs (a,b) (1≤a≤n,1≤b≤m) such that if initially the two piles have a and b stones respectively, then the first player has a winning strategy, or the game ends with a draw, or the second player has a winning strategy. Since this number may be very large, you are only asked to calculate it modulo 109+7.
There are multiple test cases. The first line of the input contains an integer T, indicating the number of test cases. For each test case:
The first line contains a binary string s (1≤∣s∣≤106) -- the binary representation of n without leading zeros.
The second line contains a binary string t (1≤∣t∣≤106) -- the binary representation of m without leading zeros.
It is guaranteed that the sum of the length of binary strings in all test cases will not exceed 2×106.
For each test case, output three integers: the number of pairs (a,b) such that first player wins, the game ends with a draw or the second player wins, correspondingly.
For the first sample: