题目链接:http://codeforces.com/contest/1064/problem/B
#include<bits/stdc++.h>
using namespace std;
#define debug puts("YES");
#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)
#define read(x,y) scanf("%d%d",&x,&y)
#define ll long long
#define lrt int l,int r,int rt
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define root l,r,rt
const int maxn =2e3+5;
const int ub=1e6;
ll powmod(ll x,ll y){ll t; for(t=1;y;y>>=1,x=x*x) if(y&1) t=t*x; return t;}
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*
题目大意:求解方程解的个数,
不难发现,把这个数转换成二进制形式,
那么符合等式的解可以看到只要是二进制的1的集合的子集就符合要求,
然后如果在零处有任何1数,那么a^x就比a大了,这明显与等式不符合。
*/
ll cnt(ll x)
{
ll tmp=0;
while(x)
{
if(x%2==1) tmp++;
x>>=1;
}
return tmp;
}
int main()
{
int t;scanf("%d",&t);
while(t--)
{
ll x;scanf("%lld",&x);
ll ans=powmod(2LL,cnt(x));
if(x==0) puts("1");
else printf("%lld\n",ans);
}
return 0;
}