#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a;
    cin >> a;
    long long count = 1;
    while (a) {
      if (a % 2 == 1) count = count * 2;
      a = a / 2;
    }
    cout << count << endl;
  }
  return 0;
}
