#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t;
  cin >> t;
  while (t--) {
    cin >> n;
    int num = 0;
    while (n) {
      if (n % 2) num++;
      n /= 2;
    }
    int ans = pow(2, num);
    cout << ans << endl;
  }
}
