#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long a, count = 0;
    cin >> a;
    for (long long i = 0; i < 31; i++) {
      if (a & (1 << i)) {
        count++;
      }
    }
    long long c = powl(2, count);
    cout << c << endl;
  }
  return 0;
}
