#include <bits/stdc++.h>
using namespace std;
int lowbit(int x) { return x & -x; }
int T, a, b, x, m, ans;
int main() {
  cin >> T;
  while (T--) {
    cin >> a;
    int ans = 1;
    while (a != 0) {
      a -= lowbit(a);
      ans *= 2;
    }
    cout << ans << endl;
  }
  return 0;
}
