#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, a;
  cin >> t;
  while (t--) {
    cin >> a;
    int ones = __builtin_popcount(a);
    cout << (1ll << ones) << endl;
  }
  return 0;
}
