#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int mod = 998244353;
int main() {
  int t, a;
  cin >> t;
  while (t--) {
    cin >> a;
    if (!a) {
      cout << 1 << endl;
      continue;
    }
    int ans = 1;
    while (a) {
      if (a & 1) ans <<= 1;
      a >>= 1;
    }
    cout << ans << endl;
  }
  return 0;
}
