#include <bits/stdc++.h>
using namespace std;
long long pow2(long long a, long long b) {
  long long sum = 1;
  while (b > 0) {
    if (b % 2 == 1) sum = (sum * a);
    a = (a * a);
    b /= 2;
  }
  return sum;
}
int main() {
  long long t;
  cin >> t;
  long long a;
  while (t--) {
    long long cnt = 0;
    cin >> a;
    while (a > 0) {
      if (a % 2 == 1) cnt++;
      a /= 2;
    }
    cout << pow2(2, cnt) << endl;
  }
  return 0;
}
