#include <bits/stdc++.h>
using namespace std;
int checkValidity(int a, int b, int c) {
  int res = 1000;
  if (a + b > c && a + c > b && b + c > a) {
    return 0;
  }
  if (a + b <= c) {
    res = min(res, c - (a + b)) + 1;
  }
  if (a + c <= b) {
    res = min(res, b - (a + c)) + 1;
  }
  if (b + c <= a) {
    res = min(res, a - (c + b)) + 1;
  }
  return res;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a;
    cin >> a;
    int temp = 0;
    while (a > 0) {
      if (a % 2 != 0) temp++;
      a = a >> 1;
    }
    long long res = pow(2, temp);
    cout << res << endl;
  }
}
