#include <bits/stdc++.h>
using namespace std;
long long pwr(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  long long t = 0;
  cin >> t;
  while (t--) {
    long long n = 0;
    cin >> n;
    long long d = __builtin_popcount(n);
    cout << pwr(2, d) << "\n";
  }
  return 0;
}
