#include <bits/stdc++.h>
using namespace std;
int binpow(int x) {
  if (x == 0) return 1;
  if (x % 2 == 0)
    return binpow(x / 2) * binpow(x / 2);
  else
    return binpow(x - 1) * 2;
}
int cntbit(int x) {
  int num = 0;
  while (x > 0) {
    if (x % 2) num++;
    x /= 2;
  }
  return num;
}
void solve() {
  int t;
  cin >> t;
  while (t--) {
    int x;
    cin >> x;
    int d = cntbit(x);
    cout << binpow(d) << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
