#include <bits/stdc++.h>
using namespace std;
int T, Pow[31], X;
int main() {
  Pow[0] = 1;
  for (int i = 1; i <= 30; i++) Pow[i] = 2 * Pow[i - 1];
  cin >> T;
  for (int t = 1; t <= T; t++) {
    cin >> X;
    int b = 0;
    while (X > 0) {
      if (X % 2) b++;
      X /= 2;
    }
    cout << Pow[b] << '\n';
  }
  return 0;
}
