#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long ret = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -f;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') ret = ret * 10 + ch - '0', ch = getchar();
  return ret * f;
}
inline void write(long long zx) {
  if (zx < 0) {
    zx = -zx;
    putchar('-');
  }
  if (zx < 10)
    putchar(zx + '0');
  else {
    write(zx / 10);
    putchar(zx % 10 + '0');
  }
}
long long T;
long long solve(long long zx) {
  if (zx == 0) return 0;
  if (zx % 2 == 0)
    return solve(zx / 2);
  else
    return 1 + solve(zx / 2);
}
int main() {
  T = read();
  while (T--) {
    long long fs = read();
    long long p = solve(fs);
    write(pow(2, p));
    putchar('\n');
  }
  return 0;
}
