#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  int t;
  cin >> t;
  long long a[33];
  a[0] = 1;
  for (int i = 1; i <= 32; i++) {
    a[i] = 2 * a[i - 1];
  }
  while (t--) {
    int n;
    cin >> n;
    bitset<32> b(n);
    int no = b.count();
    cout << a[no] << endl;
  }
  return 0;
}
