#include <bits/stdc++.h>
using namespace std;
int a, b, c, kek;
int main() {
  cin >> a;
  for (a; a > 0; a--) {
    cin >> kek;
    int pr = 1;
    while (kek) {
      if (kek & 1) pr <<= 1;
      kek >>= 1;
    }
    cout << pr << endl;
  }
}
