#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long num = 0;
    while (n) {
      if (n % 2 == 1) num++;
      n = n >> 1;
    }
    long long nn = pow(2, num);
    cout << nn;
    if (t != 0) printf("\n");
  }
  return 0;
}
