#include <bits/stdc++.h>
int main() {
  long long t = 1;
  scanf("%lld", &t);
  while (t--) {
    long long n, a = 0;
    scanf("%lld", &n);
    while (n > 0) {
      int r = n % 2;
      if (r == 1) a++;
      n = n / 2;
    }
    long long ans = pow(2, a);
    printf("%lld\n", ans);
  }
  return 0;
}
