#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int x;
    cin >> x;
    cout << (1 << __builtin_popcount(x)) << endl;
  }
  return 0;
}
