#include <bits/stdc++.h>
using namespace std;
int f(int x) {
  int k = 1;
  while (x) {
    if (x % 2) k *= 2;
    x /= 2;
  }
  return k;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    cout << f(n) << "\n";
  }
  return 0;
}
