#include <bits/stdc++.h>
using namespace std;
long long T, W;
long long QAQ(long long x) {
  long long cnt = 0;
  while (x) ++cnt, x &= x - 1;
  return cnt;
}
long long Q(long long x) {
  long long fin = 1, a = 2;
  for (; x; x >>= 1, a *= a)
    if (x & 1) fin = fin * a;
  return fin;
}
int main() {
  scanf("%lld", &T);
  while (T--) {
    cin >> W;
    long long A = QAQ(W);
    cout << Q(A) << endl;
  }
  return 0;
}
