#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    ll n;
    ll ans = 1LL;
    scanf("%lld", &n);
    while (n) {
      if (n & 1) ans <<= 1LL;
      n >>= 1LL;
    }
    printf("%lld\n", ans);
  }
}
