#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t, n, c;
  cin >> t;
  long long int pows[32];
  for (long long int i = 0; i < 32; i++)
    if (!i)
      pows[i] = 1;
    else
      pows[i] = 2 * pows[i - 1];
  while (t--) {
    cin >> n;
    c = 0;
    while (n) {
      if (n % 2) c++;
      n /= 2;
    }
    cout << pows[c] << endl;
  }
  return 0;
}
