#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int x;
    cin >> x;
    if (x == 0) {
      cout << 1 << endl;
    } else {
      int sum = 0;
      while (x > 0) {
        sum += x % 2;
        x /= 2;
      }
      cout << (1 << sum) << endl;
    }
  }
  return 0;
}
