#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, i, ans;
    cin >> n;
    i = __builtin_popcountll(n);
    ans = pow(2, i);
    cout << ans << '\n';
  }
}
