#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    int set = 0;
    while (n) {
      set += n & 1;
      n = n >> 1;
    }
    cout << (1 << set) << endl;
  }
  return 0;
}
