#include <bits/stdc++.h>
using namespace std;
long long nc3(long long n) { return (1LL * n * (n - 1) * (n - 2)) / 6; }
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int x;
    cin >> x;
    int a = __builtin_popcount(x);
    cout << (int)pow(2.0, a) << endl;
  }
  return 0;
}
