https://codeforces.com/contest/2043/problem/A

#include<bits/stdc++.h>
#define lc p<<1
#define rc p<<1|1
#define INF 2e9
using namespace std;

#define endl '\n'
using ll = long long;
using pii = pair<ll, ll>;
const double PI = acos(-1);
const int N=1e4+10;
ll qmi(int a,int x){
	ll sum=1;
	ll aa=a;
	while(x){
		if(x&1) sum*=aa;
		x>>=1;
		aa*=aa;
	}
	return sum;
}
void solve(){
	ll n;cin>>n;
//		int t=log10(n)/log10(4);//对数有精度问题,不能使用
//		ll sum=qmi(2,t);
//		cout<<sum<<endl;
//	cout<<((ll)1<<t)<<endl;
	int cnt=0;
	while(n){
		n/=4;
		cnt++;
	}
	cnt--;
	cout<<((ll)1<<cnt)<<endl;
	
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr), cout.tie(nullptr);
	
	int T = 1;
	cin>>T;
	while (T--) {
		solve();
	}
	
	return 0;
}