#include using namespace std; typedef long long LL; const int nmax = 200010; const LL mod = 1000000007; int N; int main(void){ LL i,j,urm,x,cnt,w; // freopen("txt.in","r",stdin); // freopen("txt.out","w",stdout); // ios::sync_with_stdio(false); cin >> N; while(N--){ cin >> x; cnt = w = 0; while(x){ cnt+=(x%2); if(x%2==0)++w; x/=2; } LL p = 0; for(i = 1; i <= cnt; ++i) p=p*2+1; p*=(1LL<