#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int y;
    cin >> y;
    int x = __builtin_popcount(y);
    cout << (1LL << (int)(x)) << endl;
  }
}
