#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
inline int read() {
  int f = 1, x = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -f;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long x;
    scanf("%lld", &x);
    long long now = 1;
    while (x) {
      if (x & 1) now *= 2;
      x >>= 1;
    }
    cout << now << endl;
  }
  return 0;
}
