#include <bits/stdc++.h>
using namespace std;
int countOne(long long num) {
  int count = 0;
  while (num) {
    if (num & 1) {
      ++count;
    }
    num >>= 1;
  }
  return count;
}
long long ans(int n) {
  if (n == 0) return 1;
  return 2 * ans(n - 1);
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long x;
    cin >> x;
    int n = countOne(x);
    cout << ans(n) << endl;
  }
  return 0;
}
