#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int t, a;
  scanf("%d", &t);
  for (; t--;) {
    scanf("%d", &a);
    int cnt = __builtin_popcount(a);
    printf("%d\n", 1 << cnt);
  }
  return 0;
}
