#include <bits/stdc++.h>
using namespace std;
long long int power(long long int base, long long int exponent) {
  base = base % 1000000007;
  long long int result = 1;
  while (exponent > 0) {
    if (exponent % 2 == 1) {
      result = (result * base) % 1000000007;
      ;
    }
    exponent = exponent / 2;
    base = (base * base) % 1000000007;
  }
  if (result < 0) {
    result += 1000000007;
  }
  return result;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int i, j, k, l, m, ans = 0;
    long long int n;
    cin >> n;
    long long int cnt = 0;
    while (n) {
      if (n % 2) {
        cnt++;
      }
      n /= 2;
    }
    ans = pow(2, cnt);
    cout << ans << '\n';
  }
}
