#include <bits/stdc++.h>
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count() *
               ((uint64_t) new char | 1));
long long get_random_int(long long a, long long b) {
  return uniform_int_distribution<long long>(a, b)(rng);
}
int main() {
  ios_base::sync_with_stdio(false);
  cout << fixed;
  cout.precision(10);
  if (fopen("joke.in", "r")) {
    freopen("joke.in", "r", stdin);
    freopen("joke.out", "w", stdout);
  }
  int T;
  cin >> T;
  for (int t = 0; t < T; ++t) {
    int a;
    cin >> a;
    int pc = __builtin_popcount(a);
    int res = 1;
    for (int i = 0; i < pc; ++i) {
      res *= 2;
    }
    cout << res << endl;
  }
  return 0;
}
