#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int a[10];
int main() {
  int T, N, ans;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &N);
    ans = 1;
    for (int i = 0; i <= 30; i++)
      if (N & (1 << i)) ans *= 2;
    printf("%d\n", ans);
  }
  return 0;
}
