#include <bits/stdc++.h>
using namespace std;
int solve(int a) {
  int kol = 0;
  while (a != 0) {
    kol += a % 2;
    a /= 2;
  }
  return (1 << (kol));
}
int main() {
  int a, t;
  cin >> t;
  while (t--) {
    cin >> a;
    cout << solve(a) << "\n";
  }
  return 0;
}
