#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  for (int i = 1; i <= t; i++) {
    int n;
    scanf("%d", &n);
    cout << (1LL << (__builtin_popcount(n))) << endl;
  }
}
