#include <bits/stdc++.h>
using namespace std;
long long cnt, n, t;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> t;
  while (t--) {
    cnt = 0;
    cin >> n;
    while (n > 0) {
      cnt += (n % 2);
      n /= 2;
    }
    cout << (1 << cnt) << '\n';
  }
}
