#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int test;
  cin >> test;
  while (test--) {
    long long int n;
    cin >> n;
    long long int x = __builtin_popcount(n);
    long long int y = pow(2, x);
    cout << y << "\n";
  }
}
