#include <bits/stdc++.h>
using namespace std;
int no(int a) {
  int t = 1;
  int ans = 0;
  for (int i = 0; i < 31; i++) {
    if (a & (t << i)) ans++;
  }
  return ans;
}
int main() {
  int t;
  cin >> t;
  int a;
  long long int ans = 0;
  while (t--) {
    ans = 0;
    cin >> a;
    ans = pow(2, no(a));
    cout << ans << endl;
  }
  return 0;
}
