#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    long long a;
    cin >> a;
    long long ones = 0;
    for (int i = 0; i <= 30; i++) {
      if ((1 << i) & a) {
        ones++;
      }
    }
    cout << (long long)pow((long long)2, ones) << endl;
  }
  return 0;
}
