#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
const long long N = 200000 + 5;
void peace() {
  long long n;
  cin >> n;
  long long xx = __builtin_popcount(n);
  long long ans = 1 << xx;
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  t = 1;
  cin >> t;
  while (t--) peace();
}
