#include <bits/stdc++.h>
using namespace std;
int binPow(int base, int power) {
  if (power == 0) return 1;
  if (power % 2 == 0) {
    int half = binPow(base, power / 2);
    return half * half;
  } else {
    int prev = binPow(base, power - 1);
    return prev * base;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  scanf("%d", &t);
  for (int tt = 0; tt < t; tt++) {
    int a;
    scanf("%d", &a);
    printf("%d\n", binPow(2, __builtin_popcountll(a)));
  }
  return 0;
}
