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