#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  std ::ios_base ::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long a;
    cin >> a;
    long long temp = a;
    long long one = 0;
    long long ans = 1;
    while (temp) {
      if (temp % 2) one++;
      temp /= 2;
    }
    cout << (1 << one) << endl;
  }
}
