#include using namespace std; const int mx =1e3+5; int check(long long n) { long long m = n/2; m-=2; if (m%3==0) return 1; return 0; } int main() { int t; cin>>t; while (t--) { long long n; cin>>n; if (n%2==0) { int flag = check(n); if (flag ==1) cout<<(n-1)<