#include <bits/stdc++.h>
using namespace std;
long long t, a, ans;
signed main() {
  cin >> t;
  for (long long i = 1; i <= t; i++) {
    cin >> a;
    ans = 1;
    while (a) {
      if (a % 2) ans *= 2;
      a /= 2;
    }
    cout << ans << endl;
  }
  return 0;
}
