#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, a;
  int counter = 0;
  cin >> t;
  int *answer = new int[t];
  for (int i = 0; i < t; i++) {
    cin >> a;
    while (a != 0) {
      if (a % 2 == 1) counter++;
      a >>= 1;
    }
    answer[i] = 1;
    answer[i] <<= counter;
    counter = 0;
  }
  cout << endl;
  for (int i = 0; i < t; i++) cout << answer[i] << endl;
  return 0;
}
