#include <bits/stdc++.h>
using namespace std;
long long t, a, bit[50];
int main() {
  for (int i = 0; i <= 30; i++) bit[i] = 1ll << i;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    int x, s = 0;
    cin >> x;
    for (int j = 0; j <= 30; j++)
      if (x & bit[j]) s++;
    cout << (1ll << s) << endl;
  }
}
