#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, coun = 0, ans;
  cin >> n;
  if (n == 0) {
    cout << "1\n";
    return;
  }
  while (n != 0) {
    if (n % 2 == 1) coun++;
    n = n / 2;
  }
  ans = pow(2, coun);
  cout << ans << "\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
