#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define dbg(x) cout << #x << " : " << x << endl
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define inf 1000000000000000000
priority_queue<ll, vector<ll>, greater<int>> qp;
priority_queue<ll> qr;
#define maxn 100005
#define mod 1000000007
// #define __builtin_popcount cnt_ones
ll po(ll a, ll n)
{
ll res = a, ans = 1;
while (n)
{
if (n % 2)
ans = ans * res;
res = res * res;
n /= 2;
}
return ans;
}
/**************TEMPLATES**********************/
int main()
{
ll tc;
cin >> tc;
while (tc--)
{
ll n;
cin >> n;
ll res = __builtin_popcount(n);
cout << po(2, res) << '\n';
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgZGJnKHgpIGNvdXQgPDwgI3ggPDwgIiA6ICIgPDwgeCA8PCBlbmRsCiNkZWZpbmUgcmVwKGksIGEsIGIpIGZvciAoaW50IGkgPSAoYSk7IGkgPD0gKGIpOyBpKyspCiNkZWZpbmUgaW5mIDEwMDAwMDAwMDAwMDAwMDAwMDAKcHJpb3JpdHlfcXVldWU8bGwsIHZlY3RvcjxsbD4sIGdyZWF0ZXI8aW50Pj4gcXA7CnByaW9yaXR5X3F1ZXVlPGxsPiBxcjsKI2RlZmluZSBtYXhuIDEwMDAwNQojZGVmaW5lIG1vZCAxMDAwMDAwMDA3Ci8vICNkZWZpbmUgX19idWlsdGluX3BvcGNvdW50IGNudF9vbmVzCmxsIHBvKGxsIGEsIGxsIG4pCnsKICAgIGxsIHJlcyA9IGEsIGFucyA9IDE7CiAgICB3aGlsZSAobikKICAgIHsKICAgICAgICBpZiAobiAlIDIpCiAgICAgICAgICAgIGFucyA9IGFucyAqIHJlczsKICAgICAgICByZXMgPSByZXMgKiByZXM7CiAgICAgICAgbiAvPSAyOwogICAgfQogICAgcmV0dXJuIGFuczsKfQovKioqKioqKioqKioqKipURU1QTEFURVMqKioqKioqKioqKioqKioqKioqKioqLwoKaW50IG1haW4oKQp7CgogICAgbGwgdGM7CiAgICBjaW4gPj4gdGM7CiAgICB3aGlsZSAodGMtLSkKICAgIHsKICAgICAgICBsbCBuOwogICAgICAgIGNpbiA+PiBuOwogICAgICAgIGxsIHJlcyA9IF9fYnVpbHRpbl9wb3Bjb3VudChuKTsKICAgICAgICBjb3V0IDw8IHBvKDIsIHJlcykgPDwgJ1xuJzsKICAgIH0KCiAgICByZXR1cm4gMDsKfQ==