#include<stdio.h>

#include<stdlib.h>

```
int main()
{
unsigned t=0,i,j,b=0;
scanf("%u",&t);
if(t<=1000000)
{
unsigned a[t];
for(i=0;i<t;i++)
{
scanf("%u",&a[i]);
if(a[i]>1000000000)
{
j=-1;
break;
}
}
if(j!=-1)
{
for(i=0;i<t;i++)
{
for(j=1;;j=j*2)
{ b=2*j;
if(a[i]==1||a[i]==0)
{
printf("%u\n",a[i]);
break;
}
else if(a[i]>=j&&a[i]<b)
{
printf("%u\n",j);
break;
}
}
}
}
return 0;
}
}
```