#include <bits/stdc++.h>

using namespace std;

int main() {
    long long T, k;
    scanf("%lld", &T);
    while (T--) {
        scanf("%lld", &k);
        printf("%lld\n", 1ll << __builtin_popcountll(k - 1));
    }
    return 0;
}