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