#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int n, ans = 1;
    cin >> n;
    long long int p = n;
    while (n) {
      if (n % 2 == 1) ans *= 2;
      n /= 2;
    }
    cout << ans << endl;
  }
}
