#include <bits/stdc++.h>
using namespace std;
int main() {
  long long T;
  cin >> T;
  while (T--) {
    long long n;
    cin >> n;
    if (n == 2) {
      cout << 2 << endl;
      continue;
    }
    long long tmp = n;
    long long cnt = 0;
    while (tmp != 0) {
      long long a = tmp % 2;
      if (a == 1) cnt++;
      tmp /= 2;
    }
    long long ans = 1;
    for (int i = 0; i < cnt; i++) {
      ans *= 2;
    }
    cout << ans << endl;
  }
}
