#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long t;
  cin >> t;
  for (long long i = 0; i < t; i++) {
    long long a;
    cin >> a;
    cout << (1ll << __builtin_popcountll(a)) << endl;
  }
}
