#include <bits/stdc++.h>
using namespace std;
long long int i, j;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int a, c = 0;
    cin >> a;
    while (a) {
      c += a % 2;
      a /= 2;
    }
    j = pow(2, c);
    cout << j << endl;
  }
}
