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