#include <bits/stdc++.h>
using namespace std;
long long int inf = 1e14;
long long int mod = 1e9 + 7;
char en = '\n';
long long int arr[5005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int a;
    cin >> a;
    long long int cnt1 = 0;
    for (long long int i = 0; i <= 32; i++) {
      if (a & (1ll << i)) cnt1++;
    }
    cout << (1ll << cnt1) << endl;
  }
  return 0;
}
