#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int num_tests = 0; num_tests < t; ++num_tests) {
    long a;
    cin >> a;
    long s = 0;
    while (a != 0) {
      s += a % 2;
      a /= 2;
    }
    long answer = 1;
    for (int i = 0; i < s; ++i) {
      answer *= 2;
    }
    cout << answer << endl;
  }
}
