#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7, LINF = 1e18 + 1e16;
const int INF = 1e9 + 1;
const double EPS = 1e-10;
const int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1};
class TaskB {
 public:
  void solve(istream& cin, ostream& cout) {
    int t;
    cin >> t;
    while (t--) {
      int a;
      cin >> a;
      int ans = __builtin_popcount(a);
      cout << (1ll << ans) << '\n';
    }
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  TaskB solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
