#include <bits/stdc++.h>
using namespace std;
bool check(long long a, long long b, long long c) {
  return a + b > c && b + c > a && a + c > b;
}
void printBit(long long a) {
  bitset<32> bs(a);
  cout << bs << endl;
}
long long s[3];
int32_t main() {
  ios::sync_with_stdio(0);
  long long a, b, c;
  long long T;
  cin >> T;
  while (T--) {
    cin >> a;
    cout << (1LL << (__builtin_popcount(a))) << endl;
  }
}
