#include <bits/stdc++.h>
using namespace std;
int Inp() {
  char c = getchar();
  int Neg = 1;
  while (c < '0' || c > '9') {
    if (c == '-') Neg = -1;
    c = getchar();
  }
  int Sum = 0;
  while (c >= '0' && c <= '9') {
    Sum = ((Sum << 3) + (Sum << 1)) + c - '0';
    c = getchar();
  }
  return Neg * Sum;
}
int main() {
  int n = Inp();
  for (int i = 1; i <= n; i++) printf("%d\n", (1 << __builtin_popcount(Inp())));
}
