#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, t, k, l;
  cin >> t;
  while (t--) {
    l = 1;
    cin >> a;
    k = __builtin_popcountll(a);
    for (int i = 0; i < k; i++) {
      l *= 2;
    }
    cout << l << endl;
  }
}
