#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t(0), a(0);
  cin >> t;
  while (t--) {
    cin >> a;
    int cnt(0);
    cout << (long long)pow(2, __builtin_popcount(a)) << endl;
  }
  return 0;
}
