Chef likes to solve difficult tasks. This time, he tried to solve the Big Famous Unsolvable $A+B=C$. One of his friends played a prank on Chef and randomly shuffled the bits in $A$ and $B$ (independently in each number). However, the funny thing is that the sum of the resulting numbers remained $C$ even after shuffling.
Chef is now wondering: in how many ways is it possible to shuffle the bits of $A$ and the bits of $B$ such that their sum after shuffling is equal to $C$? Let's denote the integers obtained by shuffling the bits of $A$ and $B$ by $A_s$ and $B_s$ respectively; two ways $(A_{s1}, B_{s1})$ and $(A_{s2}, B_{s2})$ are considered distinct if $A_{s1} \neq A_{s2}$ or $B_{s1} \neq B_{s2}$.
It is allowed to add any number (possibly zero) of leading zeroes, i.e. bits $0$, to $A$ and any number of leading zeroes to $B$ before shuffling the bits.

-----Input-----
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first and only line of each test case contains three space-separated integers $A$, $B$ and $C$. 

-----Output-----
For each test case, print a single line containing one integer — the number of ways to shuffle the bits.

-----Constraints-----
- $1 \le T \le 1,000$
- $1 \le A, B, C \le 10^9$
- $A+B = C$

-----Subtasks-----
Subtask #1 (50 points): $1 \le A, B, C \le 10^5$
Subtask #2 (50 points): original constraints

-----Example Input-----
2
1 2 3
369 428 797

-----Example Output-----
2
56

-----Explanation-----
Example case 1: We can consider $A=01$ and $B=10$ in binary. Then, there are two possible ways: swapping the two bits of $A$ and the two bits of $B$ ($A_s=10$, $B_s=01$ in binary, $2$ and $1$ in decimal representation) or not shuffling any bits.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'import math as ma\nimport sys\nfrom decimal import Decimal as dec\nfrom itertools import permutations\n\ndef li():\n return list(map(int , input().split()))\n\ndef num():\n return map(int , input().split())\n\ndef nu():\n return int(input())\n\ndef find_gcd(x , y):\n while (y):\n  x , y = y , x % y\n return x\n\ndef ans(index,seta,setb,carry):\n if(seta<0 or setb<0):\n  return 0\n if(index==inc):\n  if(carry==0 and seta==0 and setb==0):\n   return 1\n  else:\n   return 0\n if(dp[index][seta][setb][carry]!=-1):\n  return dp[index][seta][setb][carry]\n z=int(sc[index])\n res=0\n if(carry==z):\n  res+=ans(index+1,seta,setb,carry//2)\n  res += ans(index + 1 , seta-1 , setb-1 , (2+carry)//2)\n if((1+carry)%2==z):\n  res += ans(index + 1 , seta-1 , setb , (1+carry)//2)\n  res += ans(index + 1 , seta , setb-1 , (1+carry)//2)\n dp[index][seta][setb][carry]=res\n return res\n\nt=nu()\nfor it in range(t):\n a,b,c=num()\n sa=str(bin(a))[2:]\n sb=str(bin(b))[2:]\n zc=str(bin(c))[2:]\n ca=sa.count("1")+1\n cb=sb.count("1")+1\n cc=zc.count("1")+1\n inc=len(zc)\n sc=zc[::-1]\n dp=[-1]*inc\n for i in range(inc):\n  dp[i]=[-1]*ca\n  for j in range(ca):\n   dp[i][j]=[-1]*cb\n   for k in range(cb):\n    dp[i][j][k]=[-1]*2\n print(ans(0,ca-1,cb-1,0))'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 43331