#include <bits/stdc++.h>
using namespace std;
int t, s;
inline void workk() {
  int ans = 0;
  while (s) {
    if (s & 1) ans++;
    s >>= 1;
  }
  int ret = 1;
  for (int i = 1; i <= ans; ++i) ret *= 2;
  cout << ret << endl;
}
int main() {
  cin >> t;
  while (t--) {
    cin >> s;
    workk();
  }
  return 0;
}
