#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, temp, ans;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    ans = 1;
    cin >> temp;
    while (temp) {
      if (temp % 2) {
        ans *= 2;
        temp /= 2;
      } else {
        temp /= 2;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
