#include <bits/stdc++.h>
using namespace std;
int kvadriraj(int a, int b) {
  int rez = 1;
  for (int i = 0; i < b; i++) {
    rez *= a;
  }
  return rez;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int t, a, temp, stepen = 0;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a;
    stepen = 0;
    while (a > 0) {
      if (a % 2 == 1) {
        stepen++;
      }
      a /= 2;
    }
    cout << kvadriraj(2, stepen) << "\n";
  }
  return 0;
}
