#include <bits/stdc++.h>
using namespace std;
int t, a;
inline int cnt(int num) {
  register int siz = 0;
  while (num) {
    if (num & 1) ++siz;
    num >>= 1;
  }
  return siz;
}
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &a);
    printf("%d\n", (1 << (cnt(a))));
  }
  return 0;
}
