#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, a;
  cin >> t;
  while (t--) {
    cin >> a;
    int y = 1;
    while (a) {
      if (a & 1) y *= 2;
      a = a >> 1;
    }
    cout << y << endl;
  }
  return 0;
}
