#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long t, i, a, ans;
  cin >> t;
  while (t--) {
    ans = 0;
    cin >> a;
    if (a == 0) {
      cout << 1 << endl;
      continue;
    }
    ans = __builtin_popcountll(a);
    cout << (1 << ans) << endl;
  }
  return 0;
}
