#include <bits/stdc++.h>
using namespace std;
long long int expo(long long int a) {
  long long int res = 1LL;
  for (int i = 0; i < a; i++) {
    res *= 2;
  }
  return res;
}
int t;
int main() {
  ios_base::sync_with_stdio(false);
  ;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long int cont = 0;
    long long int resp = 0;
    long long int at;
    cin >> at;
    while (at > 0) {
      if (at % 2 == 1) cont++;
      at /= 2;
    }
    cout << expo(cont) << "\n";
  }
}
